summaryrefslogtreecommitdiffstats
path: root/lib/network
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-12-09 23:29:04 +0000
committerOlivier Blin <blino@mageia.org>2011-12-09 23:29:04 +0000
commit2837f9fcebce09c25e07bad168cef5405837661e (patch)
tree3842a63d5270fae7354c59e8ec7f1f5f3cf6856b /lib/network
parentb203c65ef80191b0dad43616bb30545b5ec58a52 (diff)
downloaddrakx-net-2837f9fcebce09c25e07bad168cef5405837661e.tar
drakx-net-2837f9fcebce09c25e07bad168cef5405837661e.tar.gz
drakx-net-2837f9fcebce09c25e07bad168cef5405837661e.tar.bz2
drakx-net-2837f9fcebce09c25e07bad168cef5405837661e.tar.xz
drakx-net-2837f9fcebce09c25e07bad168cef5405837661e.zip
shorewall: do not warn about incompatible SECTION commands in rules file
Diffstat (limited to 'lib/network')
-rw-r--r--lib/network/shorewall.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/network/shorewall.pm b/lib/network/shorewall.pm
index f07edf3..83442ba 100644
--- a/lib/network/shorewall.pm
+++ b/lib/network/shorewall.pm
@@ -28,7 +28,8 @@ sub set_config_file {
$_ .= $last_line if $last_line;
$done = 1;
} else {
- $_ = '' if /^[^#]/;
+ $_ = '' unless
+ /^#/ or $file eq 'rules' && /^SECTION/;
}
} "$::prefix${shorewall_root}/$file";
}
@@ -155,7 +156,7 @@ sub write {
my $ports_by_proto = ports_by_proto($conf->{ports});
my $has_loc_zone = to_bool(@{$conf->{loc_zone} || []});
- my ($include_drakx, $other_rules) = partition { $_ eq "INCLUDE\trules.drakx\n" } grep { !/^#/ } cat_("$::prefix${shorewall_root}/rules");
+ my ($include_drakx, $other_rules) = partition { $_ eq "INCLUDE\trules.drakx\n" } grep { !/^(#|SECTION)/ } cat_("$::prefix${shorewall_root}/rules");
#- warn if the config is already in rules.drakx and additionnal rules are configured
if (!is_empty_array_ref($include_drakx) && !is_empty_array_ref($other_rules)) {
my %actions = (