diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-21 11:38:18 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-21 11:38:18 -0700 |
commit | d3602cd91314b7e7839e132dd607e20c455f9158 (patch) | |
tree | 7bde8c533ec058ea1ef6ce90fec55ae04097db70 /src/cli_val_engine.c | |
parent | 9585b542b46c61d40c17dbcd28284e56e65cd3de (diff) | |
download | vyatta-cfg-d3602cd91314b7e7839e132dd607e20c455f9158.tar.gz vyatta-cfg-d3602cd91314b7e7839e132dd607e20c455f9158.zip |
lstat checks should have been covered on last checkin.
additional fix for 5667
Diffstat (limited to 'src/cli_val_engine.c')
-rw-r--r-- | src/cli_val_engine.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/cli_val_engine.c b/src/cli_val_engine.c index 377de76..00e891b 100644 --- a/src/cli_val_engine.c +++ b/src/cli_val_engine.c @@ -60,7 +60,7 @@ static int is_multi_node(clind_path_ref tmpl_path); static boolean -is_deactivated(const clind_path_ref *path); +is_deactivated(const char *path); /********************* * Data definitions @@ -181,7 +181,7 @@ static char** clind_get_current_value(clind_path_ref cfg_path, } else { - if (is_deactivated(&cfg_path) == FALSE) { + if (is_deactivated(clind_path_get_path_string(cfg_path)) == FALSE) { FILE* f = fopen(cfg_path_string,"r"); if(f) { char buffer[8193]; @@ -233,7 +233,7 @@ static char** clind_get_current_value(clind_path_ref cfg_path, /* Directory reference: */ - if(!check_existence || (lstat(cfg_path_string, &statbuf) == 0)) { + if(!check_existence || ((lstat(cfg_path_string, &statbuf) == 0) && is_deactivated(cfg_path_string) == FALSE)) { ret=(char**)realloc(ret,sizeof(char*)*1); ret[0]=clind_unescape(cfg_end); *ret_size=1; @@ -278,6 +278,7 @@ static char** clind_get_current_value(clind_path_ref cfg_path, strcpy(fn_node_def+strlen(fn_node_def),NODE_DEF); if ((lstat(fn_node_def, &statbuf) == 0)&& + (is_deactivated(fn_node_def) == FALSE)&& (parse_def(&def, fn_node_def, TRUE)==0)) { if(def.def_type != ERROR_TYPE) { @@ -924,13 +925,13 @@ static int clind_path_shift_cmd(clind_path_ref path,clind_cmd *cmd) { boolean -is_deactivated(const clind_path_ref *path) +is_deactivated(const char *path_string) { - if (path == NULL) { + if (path_string == NULL) { return FALSE; } - const char* path_string = clind_path_get_path_string(*path); + // const char* path_string = clind_path_get_path_string(*path); char buf[1024]; //ALSO USED AS LIMIT IN UNIONFS path length strcpy(buf,path_string); |