Make sure that /bin/bash exists before attempting to chroot.

This commit is contained in:
Bob Lantz
2013-09-11 12:00:13 -07:00
committed by Brian O'Connor
parent f344290368
commit a56e29704e
+2 -2
View File
@@ -35,9 +35,9 @@ fi
# Check whether host should be running in a chroot dir
rootdir="/var/run/mn/$host/root"
if [ -d $rootdir ]; then
if [ -d $rootdir -a -x $rootdir/bin/bash ]; then
cmd="'cd `pwd`; exec $cmd'"
cmd="chroot $rootdir bash -c $cmd"
cmd="chroot $rootdir /bin/bash -c $cmd"
fi
cmd="exec sudo mnexec -a $pid $cg $cmd"