[Libguestfs] [PATCH 0/7] copy-in/copy-out: Capture errors from tar subprocess (RHBZ#1267032).

Richard W.M. Jones rjones at redhat.com
Tue Sep 29 11:54:47 UTC 2015


Commits 3c27f3d91e1566854747bbe844186783fc84f3a8 and
1b6f0daa9ae7fcc94e389232d0c397816cda973d added an internal API for
running commands asynchronously.  It is only used by the copy-in and
copy-out APIs.

Unfortunately this made the command code very complex: it was almost
impossible to redirect stderr to a file, and there were a lot of
long-range dependencies through the file.  It was also buggy: it set
up stderr of the child process pointing pipe, but never read from the
pipe, so if the stderr output of the child process was sufficiently
large then libguestfs would deadlock (possibly this can be triggered
from a malicious filesystem too).

This patch series first reverts these commits, then adds a simpler way
to run a child process without waiting (modelled on popen()), allows
stderr errors to be captured, then reimplements copy-in/copy-out using
these new internal APIs.

Note that the patch series breaks bisection, but I can't really think
of a clearer way to reorganize it that would preserve bisection.

Rich.




More information about the Libguestfs mailing list