use check_acl for dns->no acl

This commit is contained in:
Oliver Gorwits
2017-05-10 21:13:03 +01:00
parent 156f2abfa7
commit 4df2bc45ea
2 changed files with 7 additions and 30 deletions

View File

@@ -86,13 +86,14 @@ sub check_acl {
$config = [$config] if ref [] ne ref $config;
my $addr = NetAddr::IP::Lite->new($real_ip);
my $name = hostname_from_ip($addr->addr) || '!!NO_HOSTNAME!!';
my $all = (scalar grep {m/^op:and$/} @$config);
my $name = undef; # only look up once, and only if qr// is used
INLIST: foreach my $item (@$config) {
next INLIST if $item eq 'op:and';
if (ref qr// eq ref $item) {
$name = ($name || hostname_from_ip($addr->addr) || '!!none!!');
if ($name =~ $item) {
return 1 if not $all;
}