summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-07-16 13:48:45 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-07-16 13:48:45 -0700
commit37391727ec683e1b4702daee0496a7a9b7109566 (patch)
treea39f5f229b5c9635597b091e2ca04e694cba317f /scripts
parent0512a9f3adc71d4c8952be5bf05dbd9875f36561 (diff)
downloadvyatta-cfg-37391727ec683e1b4702daee0496a7a9b7109566.tar.gz
vyatta-cfg-37391727ec683e1b4702daee0496a7a9b7109566.zip
fix for bug 5794. Comments are not allowed on multinode parent.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-comment-config.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/vyatta-comment-config.pl b/scripts/vyatta-comment-config.pl
index 2cbd81d..5e3a315 100644
--- a/scripts/vyatta-comment-config.pl
+++ b/scripts/vyatta-comment-config.pl
@@ -23,6 +23,7 @@ use strict;
use warnings;
use File::Find;
use lib "/opt/vyatta/share/perl5";
+use Vyatta::Config;
sub usage() {
@@ -55,11 +56,17 @@ if (! -e $full_path) {
$full_path = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path";
}
else {
- `echo \"Path is not valid\n\"`;
+ print "Configuation path is not valid\n";
exit 0;
}
}
+my $config = new Vyatta::Config;
+my @el = split('/',$edit_level);
+if ($config->isTagNode([ @el, @path ])) {
+ print "Cannot set comment without value for this path\n";
+ exit 0;
+}
#scan for illegal characters here: '/*', '*/'
if ($ARGV[$#ARGV] =~ /\/\*|\*\//) {
print "illegal characters found in comment\n";
@@ -80,5 +87,6 @@ else {
close($cfile);
}
-print "Done\n";
+`touch $ENV{VYATTA_TEMP_CONFIG_DIR}/.modified`;
+
exit 0;