From 868683cea06192e9c8f7f15fff3a4553d7050798 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 16 Feb 2005 15:14:45 +0000 Subject: fix whitelist display and unwhitelist call --- perl-install/standalone/drakids | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'perl-install/standalone') 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}}; } -- cgit v1.2.1