Make sure that /bin/bash exists before attempting to chroot.
This commit is contained in:
committed by
Brian O'Connor
parent
f344290368
commit
a56e29704e
@@ -35,9 +35,9 @@ fi
|
|||||||
|
|
||||||
# Check whether host should be running in a chroot dir
|
# Check whether host should be running in a chroot dir
|
||||||
rootdir="/var/run/mn/$host/root"
|
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="'cd `pwd`; exec $cmd'"
|
||||||
cmd="chroot $rootdir bash -c $cmd"
|
cmd="chroot $rootdir /bin/bash -c $cmd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmd="exec sudo mnexec -a $pid $cg $cmd"
|
cmd="exec sudo mnexec -a $pid $cg $cmd"
|
||||||
|
|||||||
Reference in New Issue
Block a user