summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <slioch@eng-140.vyatta.com>2008-04-16 13:18:14 -0700
committerMichael Larson <slioch@eng-140.vyatta.com>2008-04-16 13:18:14 -0700
commit6ec19ddffc7ff6d8806a913314ceee6565d132c9 (patch)
tree1842c0a899ac562fe204056d5af213980208678a
parentc6f6b26e6ab046bf2606bc4f85dd04f001dac40c (diff)
downloadvyatta-cfg-6ec19ddffc7ff6d8806a913314ceee6565d132c9.tar.gz
vyatta-cfg-6ec19ddffc7ff6d8806a913314ceee6565d132c9.zip
modified fix for 2525--fixes problem introduced with last fix (bug 3163)
-rw-r--r--src/cli_new.c2
-rw-r--r--src/cli_val_engine.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/cli_new.c b/src/cli_new.c
index 1ecbe83..26cc719 100644
--- a/src/cli_new.c
+++ b/src/cli_new.c
@@ -1435,7 +1435,7 @@ static int expand_string(char *stringp)
if(clind_config_engine_apply_command_path(n_cfg_path,
n_tmpl_path,
n_cmd_path,
- FALSE,
+ TRUE,
&cv,
get_cdirp(),
get_tdirp(),
diff --git a/src/cli_val_engine.c b/src/cli_val_engine.c
index adf40a4..a81f413 100644
--- a/src/cli_val_engine.c
+++ b/src/cli_val_engine.c
@@ -56,6 +56,9 @@
#include "cli_val_engine.h"
+
+static int is_multi_node(clind_path_ref tmpl_path);
+
/*********************
* Data definitions
*
@@ -129,6 +132,13 @@ static char** clind_get_current_value(clind_path_ref cfg_path,
int value_ref = 0;
*ret_size=0;
+
+ if (check_existence) {
+ if (is_multi_node(tmpl_path)) {
+ check_existence = FALSE;
+ }
+ }
+
DPRINT("get_current_value cfg[%s] tmpl[%s] chkexist=%d\n",
clind_path_get_path_string(cfg_path),
clind_path_get_path_string(tmpl_path),
@@ -217,6 +227,7 @@ static char** clind_get_current_value(clind_path_ref cfg_path,
struct stat statbuf;
/* Directory reference: */
+
if(!check_existence || (lstat(cfg_path_string, &statbuf) == 0)) {
ret=(char**)realloc(ret,sizeof(char*)*1);
ret[0]=clind_unescape(cfg_end);