From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2289560753 for ; Wed, 9 Sep 2020 21:12:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0C27514075 for ; Wed, 9 Sep 2020 21:12:31 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 7D3F41404E for ; Wed, 9 Sep 2020 21:12:29 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 43224433C3 for ; Wed, 9 Sep 2020 21:12:29 +0200 (CEST) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Date: Wed, 9 Sep 2020 21:12:21 +0200 Message-Id: <20200909191223.4187564-3-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200909191223.4187564-1-t.lamprecht@proxmox.com> References: <20200909191223.4187564-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.187 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [setup.pm] Subject: [pve-devel] applied: [PATCH container 3/5] protected_call: remove left-over rootdir/dev mkdir X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 19:12:31 -0000 commit 797e12e8a5df246d8afc53b045e632977cdf0088 got rid of our "just bind-mount the root /dev to the CT temporarily for some stuff" for good a while ago (2015), but creating the /dev directory in the CT root was kept, from what I can tell, by mistake. This can be a problem if, whyever, the CT rootfs is not mounted, as we then break a future mount as we create this /dev directory inside what would be the CTs rootfs mount point. It is then not empty anymore and a normal mount cannot happen, failing with "directory is not empty" Signed-off-by: Thomas Lamprecht --- src/PVE/LXC/Setup.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm index d424aaa..fb0be37 100644 --- a/src/PVE/LXC/Setup.pm +++ b/src/PVE/LXC/Setup.pm @@ -134,11 +134,6 @@ sub protected_call { # avoid recursion: return $sub->() if $self->{in_chroot}; - my $rootdir = $self->{rootdir}; - if (!-d "$rootdir/dev" && !mkdir("$rootdir/dev")) { - die "failed to create temporary /dev directory: $!\n"; - } - pipe(my $res_in, my $res_out) or die "pipe failed: $!\n"; my $child = fork(); @@ -149,6 +144,7 @@ sub protected_call { # avoid recursive forks $self->{in_chroot} = 1; eval { + my $rootdir = $self->{rootdir}; chroot($rootdir) or die "failed to change root to: $rootdir: $!\n"; chdir('/') or die "failed to change to root directory\n"; my $res = $sub->(); -- 2.20.1