Skip to content

Commit

Permalink
raise error if httpd-trust IP is not accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonéri Le Bouder committed Sep 27, 2012
1 parent 27b6665 commit f27dc3a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/FusionInventory/Agent/HTTP/Server.pm
Expand Up @@ -234,11 +234,26 @@ sub _handle_status {
sub _is_trusted {
my ($self, $address) = @_;

my $logger = $self->{logger};

my $source = Net::IP->new($address);

if (!$source) {
$logger->error("Not well formatted source IP: $address");
return;
}

return 0 unless $source;

return 0 unless $self->{trust};
foreach my $trust (@{$self->{trust}}) {
my $trusted = Net::IP->new($trust);

if (!$trusted) {
$logger->error("Not well formatted httpd-trust IP: $trust");
next;
}

my $result = $source->overlaps($trusted);

if (
Expand Down

0 comments on commit f27dc3a

Please sign in to comment.