From f2242e8ab84506cad5759294bf165fa8cc72a1da Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 17 Feb 2005 12:56:30 +0000 Subject: clear white list too --- perl-install/standalone/drakids | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'perl-install/standalone/drakids') diff --git a/perl-install/standalone/drakids b/perl-install/standalone/drakids index 23017544f..e47f97ec7 100644 --- a/perl-install/standalone/drakids +++ b/perl-install/standalone/drakids @@ -51,7 +51,7 @@ my $activefw = activefw->new(sub { $msg->get_path eq "/com/mandrakesoft/activefirewall" && $msg->get_member eq "Whitelist"; - clear_blacklist() if + clear_lists() if $msg->get_interface eq "com.mandrakesoft.activefirewall" && $msg->get_path eq "/com/mandrakesoft/activefirewall" && $msg->get_member eq "Clear"; @@ -61,8 +61,7 @@ my $activefw = activefw->new(sub { $msg->get_path eq "/com/mandrakesoft/activefirewall" && $msg->get_member eq "Init"; }); -init_blacklist(); -init_whitelist(); +init_lists(); $ugtk2::wm_icon = "/usr/lib/libDrakX/icons/drakfirewall.png"; my $w = ugtk2->new(N("Active Firewall")); @@ -101,8 +100,7 @@ sub sort_by_column { sub handle_init { $activefw->find_daemon; - init_blacklist(); - init_whitelist(); + init_lists(); } sub init_blacklist { @@ -148,6 +146,10 @@ sub init_whitelist { handle_whitelist($_) foreach $activefw->get_whitelist; } +sub clear_whitelist { + @{$whitelist->{data}} = (); +} + sub handle_whitelist { my ($addr) = @_; push @{$whitelist->{data}}, [ $addr, activefw::resolve_address(activefw::get_ip_address($addr)) ]; @@ -169,3 +171,13 @@ sub unwhitelist { #- delete from the list even if the above calls were unsuccessful @{$whitelist->{data}} = grep { !member($_->[0], @addr) } @{$whitelist->{data}}; } + +sub init_lists { + init_blacklist(); + init_whitelist(); +} + +sub clear_lists { + clear_blacklist(); + clear_whitelist(); +} -- cgit v1.2.1