From f71417e0209a48bb88fb614acb186109e0573941 Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Thu, 3 Apr 2008 14:18:31 -0700 Subject: fix for bug 2507 --- src/delete.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/delete.c') diff --git a/src/delete.c b/src/delete.c index bb36fd1..b95a7d9 100644 --- a/src/delete.c +++ b/src/delete.c @@ -267,6 +267,28 @@ int main(int argc, char **argv) remove_rf(FALSE); return 0; } + + /* + let's do a new check here: + -> if this is a leaf and there is a value look for a match of the value + -> make sure to check existing configuration as well as uncommitted config + */ + if (ai+1 == argc) { + //does this work up until the last value + pop_path(&m_path); + if(lstat(m_path.path, &statbuf) == 0) { + //now compare last value with that in the node.def file to determine whether to accept this delete + status = get_value(&cp, &m_path); + if (status != VTWERR_OK) { + bye("Cannot read old value %s\n", m_path.path); + } + if (!strcmp(cp,argv[argc - 1])) { + remove_rf(FALSE); + return 0; + } + } + } + fprintf(out_stream, "The specified configuration node is not valid\n"); bye("There is no appropriate template for %s", m_path.path + strlen(get_mdirp())); -- cgit v1.2.3