summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-17 12:56:30 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-17 12:56:30 +0000
commitf2242e8ab84506cad5759294bf165fa8cc72a1da (patch)
tree646c6b7b79008f3379f684f7f2579aa605899cfd /perl-install/standalone
parentd59e9b7c4af8a1ba34457f0603b89cfdcd9454c1 (diff)
downloaddrakx-f2242e8ab84506cad5759294bf165fa8cc72a1da.tar
drakx-f2242e8ab84506cad5759294bf165fa8cc72a1da.tar.gz
drakx-f2242e8ab84506cad5759294bf165fa8cc72a1da.tar.bz2
drakx-f2242e8ab84506cad5759294bf165fa8cc72a1da.tar.xz
drakx-f2242e8ab84506cad5759294bf165fa8cc72a1da.zip
clear white list too
Diffstat (limited to 'perl-install/standalone')
-rw-r--r--perl-install/standalone/drakids22
1 files changed, 17 insertions, 5 deletions
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();
+}