summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakids
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-16 15:14:45 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-16 15:14:45 +0000
commit868683cea06192e9c8f7f15fff3a4553d7050798 (patch)
tree6de50296172c35a9a44ade7412f83ab36a42f152 /perl-install/standalone/drakids
parent84ba75683b51f747a2cfa236e3533390d15324b6 (diff)
downloaddrakx-868683cea06192e9c8f7f15fff3a4553d7050798.tar
drakx-868683cea06192e9c8f7f15fff3a4553d7050798.tar.gz
drakx-868683cea06192e9c8f7f15fff3a4553d7050798.tar.bz2
drakx-868683cea06192e9c8f7f15fff3a4553d7050798.tar.xz
drakx-868683cea06192e9c8f7f15fff3a4553d7050798.zip
fix whitelist display and unwhitelist call
Diffstat (limited to 'perl-install/standalone/drakids')
-rw-r--r--perl-install/standalone/drakids13
1 files changed, 10 insertions, 3 deletions
diff --git a/perl-install/standalone/drakids b/perl-install/standalone/drakids
index c3466dd33..9e1ea085e 100644
--- a/perl-install/standalone/drakids
+++ b/perl-install/standalone/drakids
@@ -145,12 +145,16 @@ sub unblacklist {
}
sub init_whitelist {
- @{$whitelist->{data}} = map { [ $_ ] } $activefw->get_whitelist;
+ handle_whitelist($_) foreach $activefw->get_whitelist;
}
sub handle_whitelist {
my ($addr) = @_;
- push @{$whitelist->{data}}, [ $addr ];
+ push @{$whitelist->{data}}, [ $addr, activefw::resolve_address(activefw::get_ip_address($addr)) ];
+}
+
+sub get_selected_whitelist {
+ uniq(map { $whitelist->{data}[$_][0] } $whitelist->get_selected_indices);
}
sub whitelist {
@@ -160,5 +164,8 @@ sub whitelist {
}
sub unwhitelist {
- $activefw->unwhitelist($_) foreach @_;
+ my @addr = @_;
+ $activefw->unwhitelist($_) foreach @addr;
+ #- delete from the list even if the above calls were unsuccessful
+ @{$whitelist->{data}} = grep { !member($_->[0], @addr) } @{$whitelist->{data}};
}