summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-31 15:38:46 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-31 15:38:46 -0700
commit03aa6e3af09e3d12d877d459a973898a12b2e5ee (patch)
tree8f3f5253325791c53577d05bc0bc91804c16d1b4 /src
parentb3121cf6e2e025f42cb0686dcf47488e085881a0 (diff)
downloadvyatta-cfg-03aa6e3af09e3d12d877d459a973898a12b2e5ee.tar.gz
vyatta-cfg-03aa6e3af09e3d12d877d459a973898a12b2e5ee.zip
fix cli backend bug: disallow setting values for type-less nodes.
Diffstat (limited to 'src')
-rw-r--r--src/set.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/set.c b/src/set.c
index 0fa55fe..c812729 100644
--- a/src/set.c
+++ b/src/set.c
@@ -69,6 +69,12 @@ boolean set_validate(vtw_def *defp, char *valp, boolean empty_val)
free(path_end);
path_end=NULL;
}
+ if (defp->def_type == ERROR_TYPE) {
+ /* no type in def. setting value not allowed. */
+ fprintf(out_stream, "The specified configuration node is not valid\n");
+ bye("Can not set value: no type for %s, template %s",
+ m_path.path, t_path.path);
+ }
if (empty_val) {
if (defp->def_type != TEXT_TYPE || defp->tag || defp->multi){
printf("Empty string may be assigned only to TEXT type leaf node\n");