summaryrefslogtreecommitdiffstats
path: root/bin/net_applet
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-04 21:20:55 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-04 21:20:55 +0000
commitcde5d02c67078975cb1de867f914acde4c7c0ed9 (patch)
treed3f6ceed4bb28a659bc9f8758d32d0d19b7f0f08 /bin/net_applet
parentc951926f4ceade475301fc00b4af61ffdecbdd08 (diff)
downloaddrakx-net-cde5d02c67078975cb1de867f914acde4c7c0ed9.tar
drakx-net-cde5d02c67078975cb1de867f914acde4c7c0ed9.tar.gz
drakx-net-cde5d02c67078975cb1de867f914acde4c7c0ed9.tar.bz2
drakx-net-cde5d02c67078975cb1de867f914acde4c7c0ed9.tar.xz
drakx-net-cde5d02c67078975cb1de867f914acde4c7c0ed9.zip
add support for "new connection" messages
Diffstat (limited to 'bin/net_applet')
-rwxr-xr-xbin/net_applet20
1 files changed, 13 insertions, 7 deletions
diff --git a/bin/net_applet b/bin/net_applet
index c3b7ddc..5be9c67 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -538,22 +538,28 @@ sub apply_verdict_whitelist {
}
sub handle_ifw_message {
- my $attack = network::ifw::attack_to_hash(\@_);
- unless ($attack->{msg}) {
+ my $message = network::ifw::attack_to_hash(\@_);
+ unless ($message->{msg}) {
print "unhandled attack type, skipping\n";
return;
}
- enable_ifw_alert();
+ my $is_attack = $message->{prefix} ne 'NEW';
+ enable_ifw_alert() if $is_attack;
$bubble_queue->add({
title => N("Interactive Firewall"),
pixbuf => $pixbufs{firewall},
- message => $attack->{msg},
+ message => $message->{msg},
timeout => sub {
- set_verdict($attack, \&apply_verdict_ignore);
+ set_verdict($message, \&apply_verdict_ignore);
},
clicked => sub {
- disable_ifw_alert();
- ask_attack_verdict($attack);
+ if ($is_attack) {
+ disable_ifw_alert();
+ ask_attack_verdict($message);
+ } else {
+ set_verdict($message, \&apply_verdict_ignore);
+ $bubble_queue->process_next;
+ }
},
});
}