summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-21 20:13:31 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-21 20:13:31 +0000
commit44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656 (patch)
tree19e35c55dec872dfd2fbfe57e45a3955fbad2b7b /perl-install
parent126cd9c744eb59c458edf3fa6ea11f10069e890d (diff)
downloaddrakx-44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656.tar
drakx-44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656.tar.gz
drakx-44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656.tar.bz2
drakx-44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656.tar.xz
drakx-44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656.zip
uggly workaround of Gtk2::SimpleList bugs
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/standalone/drakids11
1 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/standalone/drakids b/perl-install/standalone/drakids
index e47f97ec7..48c893ae2 100644
--- a/perl-install/standalone/drakids
+++ b/perl-install/standalone/drakids
@@ -103,6 +103,13 @@ sub handle_init {
init_lists();
}
+sub list_remove_addr {
+ my ($list, @addr) = @_;
+ foreach (0 .. $#{$list}) {
+ member($list->[$_][0], @addr) and splice @$list, $_, 1;
+ }
+}
+
sub init_blacklist {
my @packets = $activefw->get_blacklist;
while (my @blacklist = splice(@packets, 0, 8)) {
@@ -139,7 +146,7 @@ sub unblacklist {
my @addr = @_;
$activefw->unblacklist($_) foreach @addr;
#- delete from the list even if the above calls were unsuccessful
- @{$blacklist->{data}} = grep { !member($_->[0], @addr) } @{$blacklist->{data}};
+ list_remove_addr($blacklist->{data}, @addr);
}
sub init_whitelist {
@@ -169,7 +176,7 @@ sub unwhitelist {
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}};
+ list_remove_addr($whitelist->{data}, @addr);
}
sub init_lists {