From 5d92d199792b1e84826a63cb3ecc852abb9cee2c Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 6 Mar 2006 18:24:50 +0000 Subject: Check, that noone creates a jail called "fulljail" --- ezjail-admin | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ezjail-admin b/ezjail-admin index 093a755..3ea5aa7 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -71,6 +71,12 @@ create) newjail_nname=`echo -n "${newjail_name}" | tr -c [:alnum:] _` newjail_root=${newjail_root:-"${ezjail_jaildir}/${newjail_name}"} + # This scenario really will only lead to real troubles in the 'fulljail' + # case, but I should still explain this to the user and not claim that + # "an ezjail would already exist" + [ "${newjail_nname}" = "basejail" -o "${newjail_nname}" = "newjail" -o "${newjail_nname}" = "fulljail" -o "${newjail_nname}" = "flavours" ] && \ + exerr "Error: ezjail needs the ${newjail_nname} directory for its own administrative purposes. Please rename the ezjail." + # jail names may lead to identical configs, eg. foo.bar.com == foo-bar.com # so check, whether we might be running into problems [ -e ${ezjail_jailcfgs}/${newjail_nname} ] && exerr "Error: an ezjail config already exists at ${ezjail_jailcfgs}/${newjail_nname}. Please rename the ezjail." -- cgit v1.2.3