[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 2/2] daemon: Remove redundant fork in commandrvf



On 14/12/12 15:20, Richard W.M. Jones wrote:
On Thu, Dec 13, 2012 at 03:22:39PM +0000, Matthew Booth wrote:
Currently the code is doing a redundant fork when passed the
COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN flag. The additional sub-process does a
chroot() which has no effect because all file handles are already open at that
point, then simply copies its input to its output.

This change simply replaces the above with a dup2 of the passed file handle to
STDIN of the command process.

NACK.  This removes the chroot call, so I don't see how it can
be right.

Did you read the comment and the linked bug?

Yes, I read it, but it doesn't make sense :) See my comment above:

The additional sub-process does a chroot() which has no effect because all file handles are already open at that point...

It passes all regression tests, so I'm fairly confident my reasoning is correct.

Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]