From 2620e2cf4aa052ea1eb69453d1832463ad3e2bd0 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sun, 29 May 2016 23:13:08 -0700 Subject: [PATCH] warn/strict for acl_security.pl --- bind8/acl_security.pl | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/bind8/acl_security.pl b/bind8/acl_security.pl index e1d42d0d5..c59dab6f1 100755 --- a/bind8/acl_security.pl +++ b/bind8/acl_security.pl @@ -1,11 +1,15 @@ +use strict; +use warnings; require 'bind8-lib.pl'; +# Globals from bind8-lib.pl +our (%config, %text, %in); # acl_security_form(&options) # Output HTML for editing security options for the bind8 module sub acl_security_form { -local $m = $_[0]->{'zones'} eq '*' ? 1 : +my $m = $_[0]->{'zones'} eq '*' ? 1 : $_[0]->{'zones'} =~ /^\!/ ? 2 : 0; print " $text{'acl_zones'}\n"; print "\n", $m == 2 ? 'checked' : '', $text{'acl_znsel'}; print "\n", $_[0]->{'defaults'} ? "" : "checked"; print "\n", $_[0]->{'views'} ? "" : "checked"; if (@views) { - local $m = $_[0]->{'vlist'} eq '*' ? 1 : + my $m = $_[0]->{'vlist'} eq '*' ? 1 : $_[0]->{'vlist'} =~ /^\!/ ? 2 : $_[0]->{'vlist'} eq '' ? 3 : 0; print "\n"; @@ -200,9 +203,9 @@ if (@views) { $m == 3 ? 'checked' : '', $text{'acl_vnone'}; print "
\n"; @@ -17,24 +21,23 @@ printf " %s\n"; - local ($v, %vcan); + my %vcan; map { $vcan{$_}++ } split(/\s+/, $_[0]->{'inviews'}); printf "\n", "_", $vcan{"_"} ? "selected" : "", "<".$text{'acl_toplevel'}.">"; - foreach $v (sort { $a->{'value'} cmp $b->{'value'} } @views) { + foreach my $v (sort { $a->{'value'} cmp $b->{'value'} } @views) { printf "\n", $v->{'value'}, $vcan{$v->{'value'}} ? "selected" : "", $v->{'value'}; @@ -83,7 +86,7 @@ printf " $text{'no'}
$text{'acl_ztypes'} \n"; -foreach $t ("master", "slave", "forward", "delegation") { +foreach my $t ("master", "slave", "forward", "delegation") { printf " %s\n", $t, $_[0]->{$t} ? "checked" : "", $text{'acl_ztypes_'.$t}; } @@ -185,7 +188,7 @@ printf " $text{'no'}
$text{'acl_vlist'}