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
This commit is contained in:
Jared Johnson 2014-12-11 16:07:32 -06:00
parent 0a7c6f0f08
commit 52c46cfec3

View File

@ -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' );