Merge pull request #170 from jaredj/fix-exclude

Don't disable greylist in absence of p0f argument
This commit is contained in:
Matt Simerson 2014-12-22 15:01:12 -08:00
commit ee01a07e71
2 changed files with 11 additions and 1 deletions

View File

@ -474,7 +474,7 @@ sub prune_db {
sub exclude {
my ( $self ) = @_;
return 1 if $self->is_immune();
return 1 if !$self->p0f_match();
return 1 if $self->{_args}{p0f} && ! $self->p0f_match();
return 1 if $self->geoip_match();
return 1 if $self->exclude_file_match();
return;

View File

@ -136,6 +136,16 @@ sub test_exclude {
ok( $self->exclude(), "Relay client results in exclude() hit" );
$self->connection->relay_client(0);
ok( ! $self->exclude(), "Non-relay client results in exclude() miss" );
my $old_p0f = $self->connection->notes('p0f');
$self->connection->notes('p0f'=> { genre => 'windows' } );
delete $self->{_args}{p0f};
ok( ! $self->exclude(), 'no p0f args = no exclusion' );
$self->{_args}{'p0f'} = 'genre,Lindows';
ok( $self->exclude(), 'p0f miss = exclusion' );
$self->{_args}{'p0f'} = 'genre,Windows';
ok( ! $self->exclude(), 'p0f hit = no exclusion' );
$self->connection->notes( p0f => $old_p0f );
}
sub test_greylist_geoip {