[Libguestfs] [PATCH] mllib: check for executable existance in run_command (RHBZ#1362357)

Pino Toscano ptoscano at redhat.com
Wed Aug 3 08:11:25 UTC 2016


On Tuesday, 2 August 2016 20:36:59 CEST Richard W.M. Jones wrote:
> On Tue, Aug 02, 2016 at 07:14:09PM +0200, Pino Toscano wrote:
> > run_command uses Unix.create_process which forks a child process, and
> > executes execve: the latter fails when the executable does not exist,
> > triggering the exit which, in older OCaml versions [1], also runs the
> > at_exit handlers.
> > 
> > Since there is not much that can be done to avoid this on the OCaml
> > side, to keep run_command working also in older OCaml version then
> > manually search for the existance of the given executable, exiting with
> > code 127 (as a shell does) in this case.
> > 
> > [1] http://caml.inria.fr/mantis/view.php?id=7209
> 
> ACK both.
> 
> virt-dib includes the "which" program in appliance/packagelist.in.
> I notice these patches don't use this program.  But is it still needed?

Yes, it's needed as "host dependency" of diskimage-builder -- meaning
it is used by the parts of it, diskimage-builder proper or core
elements, which run on the host (which means in the appliance, outside
of the build chroot).

Ditto for qemu-img, curl, kpartx (and debootstrap for building
Debian/Ubuntu images).

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160803/ab90421c/attachment.sig>


More information about the Libguestfs mailing list