Merge pull request #170 from jaredj/fix-exclude
Don't disable greylist in absence of p0f argument
This commit is contained in:
commit
ee01a07e71
@ -474,7 +474,7 @@ sub prune_db {
|
|||||||
sub exclude {
|
sub exclude {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
return 1 if $self->is_immune();
|
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->geoip_match();
|
||||||
return 1 if $self->exclude_file_match();
|
return 1 if $self->exclude_file_match();
|
||||||
return;
|
return;
|
||||||
|
@ -136,6 +136,16 @@ sub test_exclude {
|
|||||||
ok( $self->exclude(), "Relay client results in exclude() hit" );
|
ok( $self->exclude(), "Relay client results in exclude() hit" );
|
||||||
$self->connection->relay_client(0);
|
$self->connection->relay_client(0);
|
||||||
ok( ! $self->exclude(), "Non-relay client results in exclude() miss" );
|
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 {
|
sub test_greylist_geoip {
|
||||||
|
Loading…
Reference in New Issue
Block a user