diff --git a/Shorewall-perl/Shorewall/Actions.pm b/Shorewall-perl/Shorewall/Actions.pm index 6663fd94a..9faa13ba1 100644 --- a/Shorewall-perl/Shorewall/Actions.pm +++ b/Shorewall-perl/Shorewall/Actions.pm @@ -354,6 +354,8 @@ sub process_action1 ( $$ ) { sub process_actions1() { + progress_message2 "Preprocessing Action Files..."; + for my $act ( grep $targets{$_} & ACTION , keys %targets ) { new_action $act; } diff --git a/Shorewall-perl/Shorewall/Compiler.pm b/Shorewall-perl/Shorewall/Compiler.pm index 139dfa889..06e6cf20d 100644 --- a/Shorewall-perl/Shorewall/Compiler.pm +++ b/Shorewall-perl/Shorewall/Compiler.pm @@ -81,6 +81,8 @@ sub reinitialize() { # Generate the various user-exit jacket functions. # Generate the 'initialize()' function. # +# Note: This function is not called when $command eq 'check'. So it must have no side effects other +# than those related to writing to the object file. sub generate_script_1() { @@ -489,6 +491,9 @@ EOF # distribution's tools have configured IP without any Shorewall # modifications. # +# Note: This function is not called when $command eq 'check'. So it must have no side effects other +# than those related to writing to the object file. +# sub generate_script_2 () { copy $globals{SHAREDIRPL} . 'prog.functions'; @@ -584,6 +589,9 @@ sub generate_script_2 () { # Generate the 'setup_netfilter()' function that runs iptables-restore. # Generate the 'define_firewall()' function. # +# Note: This function is not called when $command eq 'check'. So it must have no side effects other +# than those related to writing to the object file. +# sub generate_script_3() { emit 'cat > ${VARDIR}/proxyarp << __EOF__'; @@ -715,7 +723,7 @@ sub compiler( $$$$ ) { initialize_chain_table; - if ( $command eq 'compile' ) { + unless ( $command eq 'check' ) { create_temp_object( $objectfile ); generate_script_1; } @@ -735,12 +743,10 @@ sub compiler( $$$$ ) { # # Report zone contents # - progress_message2 "Determining Hosts in Zones..."; zone_report; # # Do action pre-processing. # - progress_message2 "Preprocessing Action Files..."; process_actions1; # # Process the Policy File. @@ -793,7 +799,6 @@ sub compiler( $$$$ ) { # # MACLIST Filtration # - progress_message2 "$doing MAC Filtration -- Phase 1..."; setup_mac_lists 1; # # Process the rules file. @@ -811,12 +816,10 @@ sub compiler( $$$$ ) { # # MACLIST Filtration again # - progress_message2 "$doing MAC Filtration -- Phase 2..."; setup_mac_lists 2; # # Apply Policies # - progress_message2 'Applying Policies...'; apply_policy_rules; # # TCRules and Traffic Shaping @@ -834,8 +837,10 @@ sub compiler( $$$$ ) { # Accounting. # setup_accounting; - - progress_message2 'Generating Rule Matrix...'; + # + # We generate the matrix even though we don't write out the rules. That way, we insure that + # a compile of the script won't blow up during that step. + # generate_matrix; if ( $command eq 'check' ) { diff --git a/Shorewall-perl/Shorewall/Policy.pm b/Shorewall-perl/Shorewall/Policy.pm index 02634b9ff..1d5109067 100644 --- a/Shorewall-perl/Shorewall/Policy.pm +++ b/Shorewall-perl/Shorewall/Policy.pm @@ -301,6 +301,8 @@ sub default_policy( $$$ ) { } sub apply_policy_rules() { + progress_message2 'Applying Policies...'; + for my $chainref ( @policy_chains ) { my $policy = $chainref->{policy}; my $loglevel = $chainref->{loglevel}; diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index c3e8e8bfa..724ddd402 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -694,6 +694,8 @@ sub setup_mac_lists( $ ) { my $disposition = $config{MACLIST_DISPOSITION}; my $ttl = $config{MACLIST_TTL}; + progress_message2 "$doing MAC Filtration -- Phase $phase..."; + for my $hostref ( @$maclist_hosts ) { $maclist_interfaces{ $hostref->[0] } = 1; } @@ -1415,6 +1417,7 @@ sub generate_matrix() { # Set a breakpoint in this function if you want to step through generate_matrix(). # sub start_matrix() { + progress_message2 'Generating Rule Matrix...'; } # diff --git a/Shorewall-perl/Shorewall/Tc.pm b/Shorewall-perl/Shorewall/Tc.pm index 8807efb16..9480a6cb9 100644 --- a/Shorewall-perl/Shorewall/Tc.pm +++ b/Shorewall-perl/Shorewall/Tc.pm @@ -328,6 +328,8 @@ sub validate_tc_device( $$$ ) { $tcdevices{$device}{out_bandwidth} = $outband; push @tcdevices, $device; + + progress_message " Tcdevice \"$currentline\" $done."; } sub convert_rate( $$ ) { @@ -395,6 +397,7 @@ sub validate_tc_class( $$$$$$ ) { } push @tcclasses, "$device:$markval"; + progress_message " Tcclass \"$currentline\" $done."; } sub setup_traffic_shaping() { diff --git a/Shorewall-perl/Shorewall/Zones.pm b/Shorewall-perl/Shorewall/Zones.pm index 4cec6482b..2597026c9 100644 --- a/Shorewall-perl/Shorewall/Zones.pm +++ b/Shorewall-perl/Shorewall/Zones.pm @@ -304,6 +304,8 @@ sub haveipseczones() { # sub zone_report() { + progress_message2 "Determining Hosts in Zones..."; + for my $zone ( @zones ) { my $zoneref = $zones{$zone};