From 1944110b42d0283735290e33f03cc456bf095a42 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 1 Dec 2010 20:33:25 +0100 Subject: [PATCH] check for sane id Signed-off-by: Nico Schottelius --- test/cdist_tree_wrapper | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cdist_tree_wrapper b/test/cdist_tree_wrapper index fb9cd626..429237ff 100755 --- a/test/cdist_tree_wrapper +++ b/test/cdist_tree_wrapper @@ -21,8 +21,17 @@ # Wrapper script that generates cconfig from arguments # -#[ $# -eq 1 ] || __cdist_usage "cconf" . cdist-config +[ $# -ge 1 ] || __cdist_usage " " + echo "I am $__cdist_myname and have been called with $@" + +id="$1"; shift + +# FIXME: find a better definiton of sane (i.e. everything that is a valid filename) +echo "$id" | grep -q '^[A-Za-z0-9]*$' || __cdist_usage "Provide sane id, please" + + +echo mkdir -p "${cdist_confdir}/${__cdist_myname}/${id}"