]> git.ipfire.org Git - people/ms/network.git/commitdiff
Add some minor input validation for configuration settings.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Aug 2012 18:33:25 +0000 (18:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Aug 2012 18:33:25 +0000 (18:33 +0000)
functions.config

index db4d22da00fe2d6f21dfd0717b89e2ccaaa42efe..123e5f611ab0d7897372a52b3113dbd18e994efb 100644 (file)
@@ -97,8 +97,12 @@ function config_set() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        *=*)
-                               log INFO "Setting configuration option '${1}'".                 
-                               eval ${1}
+                               local key=$(cli_get_key ${1})
+                               local val=$(cli_get_val ${1})
+
+                               log INFO "Setting configuration option '${key}=${val}'".
+
+                               eval ${key}="${val}"
                                ;;
                        *)
                                warning "Invalid parameter given: ${1}"