summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorroot <root@debian.vyatta.com>2010-10-15 15:07:27 -0700
committerroot <root@debian.vyatta.com>2010-10-15 15:07:27 -0700
commit0e089de1c58c8e75e3810dafc9c98fcbd9e783cd (patch)
treeede00f9afda581c763c16254f6c5886a5da29ccd /scripts
parent4a5929f81a411342e0dd084b6541343c293eb2e8 (diff)
downloadvyatta-cfg-firewall-0e089de1c58c8e75e3810dafc9c98fcbd9e783cd.tar.gz
vyatta-cfg-firewall-0e089de1c58c8e75e3810dafc9c98fcbd9e783cd.zip
additional errors w/ location of error.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/firewall/vyatta-firewall.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/firewall/vyatta-firewall.pl b/scripts/firewall/vyatta-firewall.pl
index 74c4f9e..b1d8a25 100755
--- a/scripts/firewall/vyatta-firewall.pl
+++ b/scripts/firewall/vyatta-firewall.pl
@@ -362,7 +362,7 @@ sub update_rules {
my $ctree = chain_configured(2, $name, $tree);
if (defined($ctree)) {
# chain name must be unique in both trees
- printf STDERR 'Firewall config error: '
+ Vyatta::Config::outputError(["firewall $tree $name"], 'Firewall config error: '
. "Rule set name \"$name\" already used in \"$ctree\"\n";
exit 1;
}
@@ -377,8 +377,8 @@ sub update_rules {
# delete the chain
if (Vyatta::IpTables::Mgr::chain_referenced($table, $name, $iptables_cmd)) {
# disallow deleting a chain if it's still referenced
- print STDERR 'Firewall config error: '
- . "Cannot delete rule set \"$name\" (still in use)\n";
+ Vyatta::Config::outputError(["firewall $tree $name"],'Firewall config error: '
+ . "Cannot delete rule set \"$name\" (still in use)\n");
exit 1;
}
delete_chain($table, "$name", $iptables_cmd);
@@ -430,7 +430,7 @@ sub update_rules {
delete_chain($table, "$name", $iptables_cmd);
remove_refcnt($fw_tree_file, "$tree $name");
}
- print STDERR "Firewall config error: $err_str\n";
+ Vyatta::Config::outputError(["firewall $tree $name"],"Firewall config error: $err_str\n");
exit 1;
}
foreach (@rule_strs) {
@@ -463,7 +463,7 @@ sub update_rules {
my ($err_str, @rule_strs) = $node->rule();
if (defined($err_str)) {
- print STDERR "Firewall config error: $err_str\n";
+ Vyatta::Config::outputError(["firewall $tree $name rule $rule"],"Firewall config error: $err_str\n");
exit 1;
}
@@ -561,6 +561,7 @@ sub update_ints {
print STDERR 'Firewall config error: ' .
"\"Modify\" rule set \"$chain\" cannot be used for " .
"\"local\"\n";
+
exit 1;
}