[PC-BSD Commits] r15689 - pcbsd/current/src-qt4/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Mon Mar 5 12:34:34 PST 2012


Author: kris
Date: 2012-03-05 20:34:33 +0000 (Mon, 05 Mar 2012)
New Revision: 15689

Modified:
   pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh
Log:

Check if running as root or user when doing chroot on standard jails



Modified: pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh	2012-03-05 19:54:10 UTC (rev 15688)
+++ pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh	2012-03-05 20:34:33 UTC (rev 15689)
@@ -44,6 +44,11 @@
 if [ -e "${JDIR}/${IP}/etc/.wardenxjail" ] ; then
   HOST="`cat ${JDIR}/${IP}/etc/.wardenhost`"
   xhost + 2>/dev/null >/dev/null
+else
+ if [ "`whoami`" != "root" ] ; then
+   echo "Error: chroot can only be run as root in standard jails"
+   exit 1
+ fi
 fi
 
 # Done with error checking, now lets chroot into the jail



More information about the Commits mailing list