From 159b4a8c83ea94c6ff086555c96d45fdd357ce49 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 1 Feb 2006 19:54:26 +0000 Subject: Variable name tidy up, forbid anything but [:alnum:]_ in variable names --- ezjail-admin | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ezjail-admin') diff --git a/ezjail-admin b/ezjail-admin index f83c347..701464a 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -68,8 +68,9 @@ create) # from this list was done intentionally to permit foo.com # style directory names, however, the jail name will be # foo_com in most scripts - newjail_name=`echo ${newjail_name} | tr /~ __` - newjail_nname=`echo ${newjail_name} | tr . _` + + newjail_name=`echo -n ${newjail_name} | tr /~ __` + newjail_nname=`echo -n "${newjail_name}" | tr -c [:alnum:]_ _` newjail_root=${newjail_root:-"${ezjail_jaildir}/${newjail_name}"} # if jail root specified on command line is not absolute, @@ -175,7 +176,7 @@ delete) [ "${oldjail_name}" -a $# = 1 ] || exerr 'Usage: ezjail delete [-w] jailname' # tidy up jail name the ezjail way - oldjail_nname=`echo ${oldjail_name} | tr /~. ___`; + oldjail_nname=`echo -n ${oldjail_name} | tr -c [:alnum:]_ _`; # check for existence of jail in our records [ -f ${ezjail_jailcfgs}/${oldjail_nname} ] || exerr "Error: Nothing known about jail ${oldjail_name}." -- cgit v1.2.3