On 12/1/12 12:33 PM, Tom Eastep wrote:
> On 12/1/12 12:28 PM, Tom Eastep wrote:
>> On 12/1/12 9:41 AM, Mr Dash Four wrote:
>>>
>>>> 2. Having looked at "Creating an Action using an Extension Script" 
>>>> (http://shorewall.net/Actions.html), it would be nice if $level and 
>>>> $tag are added to the "system parameters" passed to user-defined 
>>>> actions ($chainref is already present there as $0). If that is 
>>>> possible, then the @{XX} notation is definitely going to be needed.
>>> Forgot to add: Sometimes, when I use "$0" in my actions I am getting 
>>> "invalid parameter ($0)" error, but when I use "${0}" instead, all is 
>>> well - is the use of curly braces enforced by shorewall?
>>
>> No. If you can come up with a simple test case, I'll take a look.
>>
> 
> If $0 is followed by '_' (e.g., $0_switch) then you must use ${0}. The
> preprocessor is looking for '$' followed by Perl 'word' characters
> (alphanumerics + '_').


Here's a patch that avoids this issue.

-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 84f8bc2..23bfc88 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -2481,8 +2481,8 @@ sub set_action_param( $$ ) {
 #
 sub expand_variables( \$ ) {
     my ( $lineref, $count ) = ( $_[0], 0 );
-    #                         $1      $2   $3      -     $4
-    while ( $$lineref =~ m( ^(.*?) \$({)? (\w+) (?(2)}) (.*)$ )x ) {
+    #                         $1      $2   $3      -                 $4
+    while ( $$lineref =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) 
{
 
        my ( $first, $var, $rest ) = ( $1, $3, $4);
 

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to