summaryrefslogtreecommitdiffstats
path: root/perl-install/network/drakfirewall.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-03-24 09:59:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-03-24 09:59:47 +0000
commitfbbcf8129f8c931cea1279ea5589bd657155be4f (patch)
treeb13208bdc47464e7a05809a6a1d47cbf125a29d5 /perl-install/network/drakfirewall.pm
parent86f242fd200194724a068de6474fb9d97a480355 (diff)
downloaddrakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar.gz
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar.bz2
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar.xz
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.zip
- network::shorewall::default_interfaces_silent() does not need any parameter
- network::shorewall::read() is simpler with a $o_in - network::drakfirewall::default_from_pkgs() is non interactive, better give it a do_pkgs - cleanup as little as possible
Diffstat (limited to 'perl-install/network/drakfirewall.pm')
-rw-r--r--perl-install/network/drakfirewall.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/perl-install/network/drakfirewall.pm b/perl-install/network/drakfirewall.pm
index b09342752..554f6298f 100644
--- a/perl-install/network/drakfirewall.pm
+++ b/perl-install/network/drakfirewall.pm
@@ -110,8 +110,8 @@ sub from_ports {
}
sub default_from_pkgs {
- my ($in) = @_;
- my @pkgs = $in->do_pkgs->are_installed(map { split ' ', $_->{pkg} } @all_servers);
+ my ($do_pkgs) = @_;
+ my @pkgs = $do_pkgs->are_installed(map { split ' ', $_->{pkg} } @all_servers);
[ grep {
my $s = $_;
exists $s->{force_default_selection} ?
@@ -120,15 +120,14 @@ sub default_from_pkgs {
} @all_servers ];
}
-sub get_ports {
- my ($in, $_ports) = @_;
- my $shorewall = network::shorewall::read($in, 'silent') or return;
+sub get_ports() {
+ my $shorewall = network::shorewall::read() or return;
\$shorewall->{ports};
}
sub set_ports {
my ($in, $disabled, $ports) = @_;
- my $shorewall = network::shorewall::read($in, 'not_silent') || network::shorewall::default_interfaces($in) or die N("No network card");
+ my $shorewall = network::shorewall::read($in) || network::shorewall::default_interfaces($in) or die N("No network card");
if (!$disabled || -x "$::prefix/sbin/shorewall") {
$in->do_pkgs->ensure_binary_is_installed('shorewall', 'shorewall', $::isInstall) or return;
@@ -141,12 +140,12 @@ sub set_ports {
sub get_conf {
my ($in, $disabled, $o_ports) = @_;
- my $possible_servers = default_from_pkgs($in);
+ my $possible_servers = default_from_pkgs($in->do_pkgs);
$_->{hide} = 0 foreach @$possible_servers;
if ($o_ports) {
$disabled, from_ports($o_ports);
- } elsif (my $shorewall = network::shorewall::read($in, 'silent')) {
+ } elsif (my $shorewall = network::shorewall::read()) {
$shorewall->{disabled}, from_ports(\$shorewall->{ports});
} else {
$in->ask_okcancel('', N("drakfirewall configurator