From 03aa6e3af09e3d12d877d459a973898a12b2e5ee Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 31 Oct 2007 15:38:46 -0700 Subject: fix cli backend bug: disallow setting values for type-less nodes. --- src/set.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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"); -- cgit v1.2.3