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

Richard W.M. Jones
Tue, 02 Aug 2016 19:36:59 -0000

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?

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch