From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 2E9F01FF17C for ; Wed, 9 Jul 2025 14:59:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6BBDAC3A6; Wed, 9 Jul 2025 15:00:20 +0200 (CEST) Date: Wed, 9 Jul 2025 15:00:13 +0200 From: Wolfgang Bumiller To: Filip Schauer Message-ID: References: <20250611144903.200940-1-f.schauer@proxmox.com> <20250611144903.200940-10-f.schauer@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.079 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH container v2 09/11] manage DHCP for containers with custom entrypoint 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: , Reply-To: Proxmox VE development discussion Cc: pve-devel@lists.proxmox.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Wed, Jul 09, 2025 at 02:43:06PM +0200, Filip Schauer wrote: > On 25/06/2025 10:50, Wolfgang Bumiller wrote: > > > + my $pid = PVE::LXC::find_lxc_pid($vmid); > > > + my $rootdir = "/proc/$pid/root"; > > ^ When using this path over a potentially longer period of time it's > > better to use > > > > my ($pid, $pidfd) = PVE::LXC::open_lxc_pid($vmid); > > > > The open pidfd should guard against pid reuse during these operations. > > Unfortunatelly /usr/share/lxc/hooks/dhclient-script expects a path in > $ROOTFS. Yeah. So replace the `my $pid = ...` line with what I wrote to keep the `$pidfd` around for as long as `$rootdir` is being used. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel