From 52c46cfec3d81e4ce61e0ee2e01c4e566fff2709 Mon Sep 17 00:00:00 2001 From: Jared Johnson Date: Thu, 11 Dec 2014 16:07:32 -0600 Subject: [PATCH] Fixes for ident/p0f register_genre_blocking - Make regexes case-insensitive (I don't want to mess with modifiers) - Don't compile non-regexes as regexes --- plugins/ident/p0f | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/ident/p0f b/plugins/ident/p0f index 13a7feb..3947d3e 100644 --- a/plugins/ident/p0f +++ b/plugins/ident/p0f @@ -123,7 +123,10 @@ Default: true =head2 p0f_blocked_operating_systems -If populated, systems that match the phrases and regular expressions in this list will be rejected. +If populated, systems that match the phrases and regular expressions +in this list will be rejected. + +Regular expressions are case-insensitive. Example entries: @@ -197,9 +200,9 @@ sub register_genre_blocking { return unless @patterns; for my $pattern ( @patterns ) { if ( $pattern =~ /^\/(.*)\/$/ ) { - push @{ $self->{os_block_re} }, qr/$1/; + push @{ $self->{os_block_re} }, qr/$1/i; } else { - push @{ $self->{os_block} }, qr/$1/; + push @{ $self->{os_block} }, $pattern; } } $self->register_hook( rcpt => 'rcpt_handler' );