diff --git a/shorewall/check.cgi b/shorewall/check.cgi index 86ac60a83..b9e180f77 100755 --- a/shorewall/check.cgi +++ b/shorewall/check.cgi @@ -2,6 +2,9 @@ # check.cgi # Check if the firewall is valid +use strict; +use warnings; +our (%text, %config); require './shorewall-lib.pl'; &ui_print_header(undef, $text{'check_title'}, ""); diff --git a/shorewall/clear.cgi b/shorewall/clear.cgi index 0a2969f36..6f26fe55b 100755 --- a/shorewall/clear.cgi +++ b/shorewall/clear.cgi @@ -2,14 +2,18 @@ # clear.cgi # Clear out all rules +use strict; +use warnings; +our (%config, %text, %access); require './shorewall-lib.pl'; + if ($access{'nochange'}) { &redirect("/"); exit 0; } &error_setup($text{'clear_err'}); -$out = &backquote_logged("$config{'shorewall'} clear 2>&1"); +my $out = &backquote_logged("$config{'shorewall'} clear 2>&1"); if ($?) { &error("
$out
"); } diff --git a/shorewall/delete.cgi b/shorewall/delete.cgi index 753914f53..8dfb2c51c 100755 --- a/shorewall/delete.cgi +++ b/shorewall/delete.cgi @@ -1,16 +1,19 @@ #!/usr/bin/perl # Delete a bunch of table rows +use strict; +use warnings; +our (%in, %text); require './shorewall-lib.pl'; &ReadParse(); &can_access($in{'table'}) || &error($text{'list_ecannot'}); -$pfunc = &get_parser_func(\%in); +my $pfunc = &get_parser_func(\%in); &error_setup($text{'delete_err'}); -@d = split(/\0/, $in{'d'}); +my @d = split(/\0/, $in{'d'}); scalar(@d) || &error($text{'delete_enone'}); &lock_table($in{'table'}); -foreach $idx (sort { $b <=> $a } @d) { +foreach my $idx (sort { $b <=> $a } @d) { &delete_table_row($in{'table'}, $pfunc, $idx); } &unlock_table($in{'table'}); diff --git a/shorewall/index.cgi b/shorewall/index.cgi index 9e02cd15c..c805bb207 100755 --- a/shorewall/index.cgi +++ b/shorewall/index.cgi @@ -2,6 +2,10 @@ # index.cgi # Display icons for the various shorewall configuration files +use strict; +use warnings; +our (%text, %config, $module_name, $shorewall_version, + $module_config_directory, @shorewall_files, %access); require './shorewall-lib.pl'; if (!&has_command($config{'shorewall'})) { @@ -12,9 +16,10 @@ if (!&has_command($config{'shorewall'})) { else { # Get the version $shorewall_version = &get_shorewall_version(1); - &open_tempfile(VERSION, ">$module_config_directory/version"); - &print_tempfile(VERSION, $shorewall_version,"\n"); - &close_tempfile(VERSION); + my $fh; + &open_tempfile($fh, ">$module_config_directory/version"); + &print_tempfile($fh, $shorewall_version,"\n"); + &close_tempfile($fh); &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("shorewall", "doc", "google"), @@ -28,10 +33,10 @@ else { } else { # Just show the file icons - @files = grep { &can_access($_) } @shorewall_files; - @titles = map { $text{&clean_name($_)."_title"}."
($_)" } @files; - @links = map { "list.cgi?table=".$_ } @files; - @icons = map { "images/".$_.".gif" } @files; + my @files = grep { &can_access($_) } @shorewall_files; + my @titles = map { $text{&clean_name($_)."_title"}."
($_)" } @files; + my @links = map { "list.cgi?table=".$_ } @files; + my @icons = map { "images/".$_.".gif" } @files; &icons_table(\@links, \@titles, \@icons, 4); # Check if shorewall is running by looking for the 'shorewall'