summaryrefslogtreecommitdiff
path: root/src/delete.c
diff options
context:
space:
mode:
authorMichael Larson <slioch@eng-140.vyatta.com>2008-04-22 17:28:00 -0700
committerMichael Larson <slioch@eng-140.vyatta.com>2008-04-22 17:28:00 -0700
commit52b1e7ee61b6ce0e046371260dc13e333e3f62ca (patch)
tree0374f8070b74327be47f2dd7b0efc8bd117bfb7e /src/delete.c
parent6ec19ddffc7ff6d8806a913314ceee6565d132c9 (diff)
downloadvyatta-cfg-52b1e7ee61b6ce0e046371260dc13e333e3f62ca.tar.gz
vyatta-cfg-52b1e7ee61b6ce0e046371260dc13e333e3f62ca.zip
create def file to mark configuration nodes that are created by default, rather than a node with a default value created by a
user. partial fix for bug 1219. Allows system to differentiate between active def nodes versus user created nodes with def values.
Diffstat (limited to 'src/delete.c')
-rw-r--r--src/delete.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c
index aa83796..9bdb3ed 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -64,7 +64,7 @@ static boolean has_default(char **def, int size)
}
static void reset_default(char *def_val)
{
- char *command;
+ char *command,*def_cmd;
boolean has_default = 1;
if (def_val == NULL) {
return;
@@ -74,7 +74,11 @@ static void reset_default(char *def_val)
command = my_malloc(strlen(m_path.path) + 100, "set");
sprintf(command, "echo %s > %s/node.val", def_val, m_path.path);
system(command);
+ def_cmd = malloc(strlen(m_path.path) + 12);
+ sprintf(def_cmd, "touch %s/def",m_path.path);
+ system(def_cmd);
free(command);
+ free(def_cmd);
}
}
/***************************************************