From 92189d2b84b4b9a6efa1b1d988d7b79aa4672680 Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Mon, 21 Jun 2010 13:20:09 -0700 Subject: fix for bug 5708. disallow leafs and multis from being deactivated in this release. --- scripts/vyatta-activate-config.pl | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/vyatta-activate-config.pl b/scripts/vyatta-activate-config.pl index 47d91d7..6226f81 100644 --- a/scripts/vyatta-activate-config.pl +++ b/scripts/vyatta-activate-config.pl @@ -81,19 +81,18 @@ my $path = join '/', @path; my $full_path = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path"; -if (! -e $full_path) { - $path = join '/', @path[0..$#path-1]; - my $leaf = "$ENV{VYATTA_TEMP_CONFIG_DIR}/$path/node.val"; +if (-e $full_path) { + my $leaf = "$full_path/node.val"; if (-e $leaf) { #prevent setting on leaf or multi, check for node.val - printf("Cannot activate/deactivate end node\n"); - exit 1; - } - else { - printf("This command is not valid: $path\n"); + printf("Cannot deactivate end node\n"); exit 1; } } +else { + printf("This configuration element does not exist: " . join(' ', @path) . "\n"); + exit 1; +} ####################################################### #now check for nesting of the activate/deactivate nodes -- cgit v1.2.3