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

Reply via email to