Re: [Qemu-devel] [PATCH] fsdev: fix virtfs-proxy-helper cwd

2017-05-20 Thread Greg Kurz
On Fri, 19 May 2017 17:19:10 -0500 Eric Blake wrote: > On 05/19/2017 09:30 AM, Greg Kurz wrote: > > Since chroot() doesn't change the current directory, it is indeed a good > > practice to chdir() to the target directory and then then chroot(), or > > to chroot() to the target directory and then

Re: [Qemu-devel] [PATCH] fsdev: fix virtfs-proxy-helper cwd

2017-05-19 Thread Eric Blake
On 05/19/2017 09:30 AM, Greg Kurz wrote: > Since chroot() doesn't change the current directory, it is indeed a good > practice to chdir() to the target directory and then then chroot(), or > to chroot() to the target directory and then chdir("/"). > > The current code does neither of them actually

[Qemu-devel] [PATCH] fsdev: fix virtfs-proxy-helper cwd

2017-05-19 Thread Greg Kurz
Since chroot() doesn't change the current directory, it is indeed a good practice to chdir() to the target directory and then then chroot(), or to chroot() to the target directory and then chdir("/"). The current code does neither of them actually. Let's go for the latter. This doesn't fix any se