From 363a4e901623aff21bd6445b1018148cbcdd33cc Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 20 May 2007 16:25:53 +0000 Subject: [PATCH] Fix last change fiasco git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6422 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Config.pm | 23 +++++++++++++++++++++++ Shorewall-perl/Shorewall/Rules.pm | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 01f681159..3b655dccf 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -53,6 +53,7 @@ our @EXPORT = qw( propagateconfig append_file run_user_exit + run_user_exit1 generate_aux_config %config @@ -1179,6 +1180,28 @@ sub run_user_exit( $ ) { } } +sub run_user_exit1( $ ) { + my $file = find_file $_[0]; + + if ( -f $file ) { + progress_message "Processing $file..."; + # + # File may be empty -- in which case eval would fail + # + push_open $file; + + if ( read_a_line ) { + close_file; + + unless (my $return = eval `cat $file` ) { + fatal_error "Couldn't parse $file: $@" if $@; + fatal_error "Couldn't do $file: $!" unless defined $return; + fatal_error "Couldn't run $file"; + } + } + } +} + # # Generate the aux config file for Shorewall Lite # diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 6a2ed7884..5f152b55f 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -513,7 +513,7 @@ sub add_common_rules() { new_standard_chain output_chain( $interface ); } - run_user_exit 'initdone'; + run_user_exit1 'initdone'; setup_blacklist; @@ -777,7 +777,7 @@ sub setup_mac_lists( $ ) { 'done' ); } - run_user_exit 'maclog'; + run_user_exit1 'maclog'; log_rule_limit $level, $chainref , $chain , $disposition, '', '', 'add', '' if $level ne ''; add_rule $chainref, "-j $target";