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

svn at pcbsd.org svn at pcbsd.org
Mon Mar 12 14:28:01 PDT 2012


Author: kris
Date: 2012-03-12 21:28:00 +0000 (Mon, 12 Mar 2012)
New Revision: 15795

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

Add a check to make sure we don't create a jail with the same hostname



Modified: pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh	2012-03-12 21:18:01 UTC (rev 15794)
+++ pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh	2012-03-12 21:28:00 UTC (rev 15795)
@@ -31,6 +31,16 @@
   exit 5
 fi
 
+# Make sure we don't have a host already with this name
+for i in `ls -d ${JDIR}/*`
+do
+  if [ ! -e "${i}/etc/warden/host" ] ; then continue ; fi
+  if [ "`cat ${i}/etc/warden/host`" = "$HOST" ] ; then
+    echo "ERROR: A jail with this hostname already exists!"
+    exit 5
+  fi
+done
+
 # Check if we need to download the chroot file
 if [ ! -e "${WORLDCHROOT}" ] ; then downloadchroot ; fi
 



More information about the Commits mailing list