summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-08-02 14:48:35 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-08-02 14:48:35 -0700
commit20e764c614aaee654bbe492378018aae9327c9f5 (patch)
tree5f3039febd2fc56c317f8a062fad17c62ad0bf26
parent4dfeec4e446fe9193ca78cde232b89d317b288ba (diff)
downloadvyatta-cfg-20e764c614aaee654bbe492378018aae9327c9f5.tar.gz
vyatta-cfg-20e764c614aaee654bbe492378018aae9327c9f5.zip
eval "allowed:" script in template
* this emulates the original behavior that "allowed:" script is "eval"ed rather than "exec"ed.
-rw-r--r--src/cstore/cstore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp
index 28c9d63..e5de5b4 100644
--- a/src/cstore/cstore.cpp
+++ b/src/cstore/cstore.cpp
@@ -626,7 +626,11 @@ Cstore::getCompletionEnv(const vector<string>& comps, string& env)
if (def.def_enumeration) {
cmd_str += (C_ENUM_SCRIPT_DIR + "/" + def.def_enumeration);
} else {
- cmd_str += def.def_allowed;
+ string astr = def.def_allowed;
+ shell_escape_squotes(astr);
+ cmd_str += "_cstore_internal_allowed () { eval '";
+ cmd_str += astr;
+ cmd_str += "'; }; _cstore_internal_allowed";
}
char *buf = (char *) malloc(MAX_CMD_OUTPUT_SIZE);