diff --git a/lib/img-functions b/lib/img-functions index 0f3b82c3d..75ff5560b 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -56,11 +56,11 @@ function ensure_sudo () { # Helper function to run a command inside the chroot function run_in_target () { - # Force the inclusion of /usr/local/bin in PATH, this is needed for some - # distros that does not include /usr/local/bin in the sudoers secure_path. + # Force the inclusion of a typical set of dirs in PATH, this is needed for guest + # distros that have path elements not in the host PATH. # Note that we're not expanding PATH during argument processing, the \$ # will preserve the PATH syntax until after the sh command runs - cmd="PATH=\$PATH:/usr/local/bin ; $@" + cmd="PATH=\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ; $@" # -E to preserve http_proxy ORIG_HOME=$HOME export HOME=/root