fix ACL content accepted by check_acl_*

This commit is contained in:
Oliver Gorwits
2017-06-22 12:23:19 +01:00
parent 728e23cdf7
commit b9e6e928af
2 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2.036001 - 2017-06-22
[BUG FIXES]
* fix ACL content accepted by check_acl_*
2.036000 - 2017-06-22 2.036000 - 2017-06-22
[NEW FEATURES] [NEW FEATURES]

View File

@@ -40,7 +40,7 @@ C<$setting_name> can contain.
sub check_acl_no { sub check_acl_no {
my ($thing, $setting_name) = @_; my ($thing, $setting_name) = @_;
return 1 unless $thing and $setting_name; return 1 unless $thing and $setting_name;
return check_acl($thing, setting($setting_name)); return check_acl($thing, (setting($setting_name) || $setting_name));
} }
=head2 check_acl_only( $ip | $instance, $setting_name ) =head2 check_acl_only( $ip | $instance, $setting_name )
@@ -58,7 +58,7 @@ sub check_acl_only {
my ($thing, $setting_name) = @_; my ($thing, $setting_name) = @_;
return 0 unless $thing and $setting_name; return 0 unless $thing and $setting_name;
# logic to make an empty config be equivalent to 'any' (i.e. a match) # logic to make an empty config be equivalent to 'any' (i.e. a match)
my $config = setting($setting_name); my $config = (setting($setting_name) || $setting_name);
return 1 if not $config # undef or empty string return 1 if not $config # undef or empty string
or ((ref [] eq ref $config) and not scalar @$config); or ((ref [] eq ref $config) and not scalar @$config);
return check_acl($thing, $config); return check_acl($thing, $config);