On 01/20/2013 07:11 AM, Tom Eastep wrote:

> 2)  The '@' Shorewall variables are now writable using the ?SET directive.
> 
>     The variables are now also used when generating the contents of
>     --log-prefix in logging rules. Within an action body, the two
>     fields in the --log-prefix are:
> 
>         @chain       -- Existing variable.
>       @disposition -- New variable.
> 
>     When either of these are undefined or empty, the compiler uses
>     the same value as previously.
> 
>     When a non-inlined action is entered, @disposition is given the
>     empty value. When an inline action is entered, @disposition is not
>     altered.
> 
>     When any action is exited, the variables revert to their values
>     when the action was entered.

This change broke the ability to SET normal shell variables. Patch attached.

-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 \________________________________________________
commit d31221b03c5128e33ede5984ebe3babf402ec8e2
Author: Tom Eastep <[email protected]>
Date:   Sun Jan 20 07:26:10 2013 -0800

    Fix variable assignment.
    
    Signed-off-by: Tom Eastep <[email protected]>

diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm
index b6696e1..1aeba5d 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -2283,13 +2283,13 @@ sub process_compiler_directive( $$$$ ) {
 			       if ( ( $1 || '' ) eq '@' ) {
 				   $var = numeric_value( $var ) if $var =~ /^\d/;
 				   $var = $2 || 'chain';
-				   directive_error( "Action variables may only be SET in the body of an action", $filename, $linenumber ) unless $actparms{0};
+				   directive_error( "Shorewall variables may only be SET in the body of an action", $filename, $linenumber ) unless $actparms{0};
 				   my $val = $actparms{$var} = evaluate_expression ( $expression,
 										     $filename,
 										     $linenumber );
 				   $parmsmodified = 1;
 			       } else {
-				   $variables{$1} = evaluate_expression( $expression,
+				   $variables{$2} = evaluate_expression( $expression,
 									 $filename,
 									 $linenumber );
 			       }

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to