On 3/14/11 4:16 PM, Steven Jan Springl wrote:
> Tom
> 
> If params contains:
> 
> NULL=
> 
> and rules contains:
> 
> ACCEPT  net:eth0$NULL  lan  tcp  22
> 
> The following error message is produced:
> 
> ERROR: Unknown destination zone (OLDPWD) : /etc/shorewallER/rules (line 15)
> 
> If NULL is set to a value or the line removed and the rules file changed 
> accordingly the error does not occur, but the following message is produced: 
> 
> WARNING: Param line (export OLDPWD) ignored

Thanks, Steven.

I've already been working on a similar problem; please apply the
attached 3 patches and see if things improve.

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Config.pm 
b/Shorewall/Perl/Shorewall/Config.pm
index de2208a..049adbc 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -2948,20 +2948,21 @@ sub get_params() {
                    }
                }       
            }
-       } elsif ( $params[0] =~ /^export (.*?)="/ ) {
+       } elsif ( $params[0] =~ /^export (.*?)="/ || $params[0] =~ /^export 
([^\s=]+)\s*$/ ) {
            #
            # getparams interpreted by older (e.g., RHEL 5) Bash
            #
            # - Variable names preceded by 'export '
            # - Variable values are delimited by double quotes
            # - Embedded single quotes are escaped with '\'
+           # - Valueless variables ( e.g., 'export foo') are supported
            #
            for ( @params ) {
                if ( /^export (.*?)="(.*[^\\])"$/ ) {
                    $params{$1} = $2 unless $1 eq '_';
                } elsif ( /^export (.*?)="(.*)$/ ) {
                    $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
-               } elsif ( /^export (.*)\s+$/ || /^export (.*)=""$/ ) {
+               } elsif ( /^export ([^\s=])\s*$/ || /^export (.*)=""$/ ) {
                    $params{$1} = '';
                } else {
                    if ($variable) {
diff --git a/Shorewall/Perl/Shorewall/Config.pm 
b/Shorewall/Perl/Shorewall/Config.pm
index 5c8db72..bcdf04b 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -2963,7 +2963,7 @@ sub get_params() {
                    $params{$1} = $2 unless $1 eq '_';
                } elsif ( /^export (.*?)="(.*)$/ ) {
                    $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
-               } elsif ( /^export ([^\s=])\s*$/ || /^export (.*)=""$/ ) {
+               } elsif ( /^export ([^\s=]+)\s*$/ || /^export (.*)=""$/ ) {
                    $params{$1} = '';
                } else {
                    if ($variable) {
diff --git a/Shorewall/Perl/Shorewall/Config.pm 
b/Shorewall/Perl/Shorewall/Config.pm
index f9f4058..d537a8f 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -2908,7 +2908,7 @@ sub get_params() {
     if ( -f $fn ) {
        progress_message2 "Processing $fn ...";
 
-       my $command = "$globals{SHAREDIRPL}/getparams $fn " . join( ':', 
@config_path );
+       my $command = "env -i PATH=$ENV{PATH} TERM=$ENV{TERM} 
$globals{SHAREDIRPL}/getparams $fn " . join( ':', @config_path );
        #
        # getparams silently sources the params file under 'set -a', then 
executes 'export -p'
        #
@@ -3006,7 +3006,7 @@ sub get_params() {
            print "PARAMS:\n";
            my $value;
            while ( ($variable, $value ) = each %params ) {
-               print "   $variable='$value'\n";
+               print "   $variable='$value'\n" unless 
$compiler_params{$variable};
            }
        }
     }

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to