summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2006-02-01 19:54:26 +0000
committererdgeist <erdgeist@erdgeist.org>2006-02-01 19:54:26 +0000
commit159b4a8c83ea94c6ff086555c96d45fdd357ce49 (patch)
treeaac7d7563d896b184a4177037316e849ac8227df
parent8fda6980120c2815a13e439436b166e0b504447e (diff)
Variable name tidy up, forbid anything but [:alnum:]_ in variable names
-rwxr-xr-xezjail-admin7
1 files changed, 4 insertions, 3 deletions
diff --git a/ezjail-admin b/ezjail-admin
index f83c347..701464a 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -68,8 +68,9 @@ create)
68 # from this list was done intentionally to permit foo.com 68 # from this list was done intentionally to permit foo.com
69 # style directory names, however, the jail name will be 69 # style directory names, however, the jail name will be
70 # foo_com in most scripts 70 # foo_com in most scripts
71 newjail_name=`echo ${newjail_name} | tr /~ __` 71
72 newjail_nname=`echo ${newjail_name} | tr . _` 72 newjail_name=`echo -n ${newjail_name} | tr /~ __`
73 newjail_nname=`echo -n "${newjail_name}" | tr -c [:alnum:]_ _`
73 newjail_root=${newjail_root:-"${ezjail_jaildir}/${newjail_name}"} 74 newjail_root=${newjail_root:-"${ezjail_jaildir}/${newjail_name}"}
74 75
75 # if jail root specified on command line is not absolute, 76 # if jail root specified on command line is not absolute,
@@ -175,7 +176,7 @@ delete)
175 [ "${oldjail_name}" -a $# = 1 ] || exerr 'Usage: ezjail delete [-w] jailname' 176 [ "${oldjail_name}" -a $# = 1 ] || exerr 'Usage: ezjail delete [-w] jailname'
176 177
177 # tidy up jail name the ezjail way 178 # tidy up jail name the ezjail way
178 oldjail_nname=`echo ${oldjail_name} | tr /~. ___`; 179 oldjail_nname=`echo -n ${oldjail_name} | tr -c [:alnum:]_ _`;
179 180
180 # check for existence of jail in our records 181 # check for existence of jail in our records
181 [ -f ${ezjail_jailcfgs}/${oldjail_nname} ] || exerr "Error: Nothing known about jail ${oldjail_name}." 182 [ -f ${ezjail_jailcfgs}/${oldjail_nname} ] || exerr "Error: Nothing known about jail ${oldjail_name}."