From 8a6a03a22cb502d670e44f14ad28ee1afe74f08f Mon Sep 17 00:00:00 2001 From: Aaron Klingaman Date: Thu, 2 Dec 2004 00:00:25 +0000 Subject: [PATCH] mildly sanitize network configuration files --- conf_files/pl_validateconf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 conf_files/pl_validateconf diff --git a/conf_files/pl_validateconf b/conf_files/pl_validateconf new file mode 100644 index 0000000..1b9d183 --- /dev/null +++ b/conf_files/pl_validateconf @@ -0,0 +1,22 @@ +#!/bin/sh + +# Valid environment variables to appear in a planetlab config file +TAGS='IP_METHOD HOST_NAME DOMAIN_NAME PROXY_SERVER + IP_ADDRESS IP_GATEWAY IP_NETMASK IP_NETADDR IP_BROADCASTADDR + IP_DNS1 IP_DNS2 PRIMARY_DEV PRIMARY_MAC' + +# Valid characters that variable can be set to +CHARS='[:alnum:]\.: _-' + +REGEX='' + +for t in $TAGS +do + if [ "$REGEX" == "" ] + then + REGEX="^$t" + else + REGEX="$REGEX|^$t" + fi +done +/bin/egrep "($REGEX)\=\\\"[$CHARS]*\\\"\s*$" -- 2.43.0