On 10/27/2015 11:38 AM, matt darfeuille wrote:
Thank you Tom for the temporary fix!!!:)

While waiting for your answer I did it manually:

shorewall compile -e $PWD firewall

Then I "sshed" both files(firewall firewall.conf) to openwrt in the
VARLIB directory followed by shorewall-lite start which give me the
following errors:

/etc/shorewall-lite/lib/shorewall-lite/firewall: line 2251: syntax
error: unexpected word (expecting ")")
/etc/shorewall-lite/lib/shorewall-lite/firewall: line 2263: syntax
error: unexpected word (expecting ")")
/etc/shorewall-lite/lib/shorewall-lite/firewall: line 3177: !::=: not
found
/etc/shorewall-lite/lib/shorewall-lite/firewall: line 3177: !C:=: not
found
/etc/shorewall-lite/lib/shorewall-lite/firewall: line 3177:
CommonProgramFiles(x86)=: not found

Line 2251 is     CommonProgramFiles(x86)=
Line 2263 is     ProgramFiles(x86)=
Line 3177 is initialize

I am not sure why environmental window variables are included in the
compiled script!:)


Yuck -- Don't know why the Cygwin shells don't filter these out of the output of 'export -p', since obviously no Posix-complient code can deal with them. The attached patch should eliminate this issue.

Question/request

Since /var is an tmpfs partition on openwrt, would it be possible to
have a variable that could be used to set only the path for firewall,
firewall.conf and the restore file thus every temporarily file would
still go in /var but those file needed across reboot would be on the
rootfs partition!?:)
EG:
VARLIB=/var/lib
PERSIST_REBOOT_FILE=/etc/...

I'm going to pass on this one -- the change would be 100s of lines of code and difficult to test properly.


On openwrt the logs are not saved in a file, would it be possible to
specify a command(logread) instead of a filename for the variable
LOGFILE in shorewall.conf?:)
EG:
LOGFILE=logread


For years, Shorewall has had code that tries to deal with this issue:

        if [ -n "$(syslog_circular_buffer)" ]; then
            g_logread="logread | tac"
        elif [ -r $LOGFILE ]; then
            g_logread="tac $LOGFILE"
        else
            fatal_error "LOGFILE ($LOGFILE) does not exist! ..."
        fi

Has OpenWRT changed so that this code doesn't work?

-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 f0acfd6..59f82e0 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -5188,19 +5188,23 @@ sub get_params( $ ) {
            $shell = BASH;
 
            for ( @params ) {
-               if ( /^declare -x (.*?)="(.*[^\\])"$/ ) {
-                   $params{$1} = $2 unless $1 eq '_';
-               } elsif ( /^declare -x (.*?)="(.*)$/ ) {
-                   $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
-               } elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) {
-                   $params{$1} = '';
-               } else {
-                   chomp;
-                   if ($variable) {
-                       s/"$//;
-                       $params{$variable} .= $_;
+               my $var = $1;
+
+               unless ( $var =~ /\(/ ) {
+                   if ( /^declare -x (.*?)="(.*[^\\])"$/ ) {
+                       $params{$var} = $2 unless $1 eq '_';
+                   } elsif ( /^declare -x (.*?)="(.*)$/ ) {
+                       $params{$variable=$var} = $2 eq '"' ? '' : "${2}\n";
+                   } elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ 
) {
+                       $params{$var} = '';
                    } else {
-                       warning_message "Param line ($_) ignored" unless $bug++;
+                       chomp;
+                       if ($variable) {
+                           s/"$//;
+                           $params{$variable} .= $_;
+                       } else {
+                           warning_message "Param line ($_) ignored" unless 
$bug++;
+                       }
                    }
                }
            }
@@ -5216,19 +5220,23 @@ sub get_params( $ ) {
            $shell = OLDBASH;
 
            for ( @params ) {
-               if ( /^export (.*?)="(.*[^\\])"$/ ) {
-                   $params{$1} = $2 unless $1 eq '_';
-               } elsif ( /^export (.*?)="(.*)$/ ) {
-                   $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
-               } elsif ( /^export ([^\s=]+)\s*$/ || /^export (.*)=""$/ ) {
-                   $params{$1} = '';
-               } else {
-                   chomp;
-                   if ($variable) {
-                       s/"$//;
-                       $params{$variable} .= $_;
+               my $var = $1;
+
+               unless ( $var =~ /\(/ ) {
+                   if ( /^export (.*?)="(.*[^\\])"$/ ) {
+                       $params{$var} = $2 unless $1 eq '_';
+                   } elsif ( /^export (.*?)="(.*)$/ ) {
+                       $params{$variable=$var} = $2 eq '"' ? '' : "${2}\n";
+                   } elsif ( /^export ([^\s=]+)\s*$/ || /^export (.*)=""$/ ) {
+                       $params{$var} = '';
                    } else {
-                       warning_message "Param line ($_) ignored" unless $bug++;
+                       chomp;
+                       if ($variable) {
+                           s/"$//;
+                           $params{$variable} .= $_;
+                       } else {
+                           warning_message "Param line ($_) ignored" unless 
$bug++;
+                       }
                    }
                }
            }
------------------------------------------------------------------------------
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to