On 02/09/2013 08:03 PM, Tom Eastep wrote: >>>> If that cannot be accomplished, then I see little use of your patch to >>>> be >>>> honest and I may as well revert back to my ?IF ?ELSE ?ENDIF statements >>>> I've had before and get it over with. >>> >>> Well, it isn't happening in 4.5.13. So if you think it is better to code >>> your ?ifÅ ?else mess than adding a single "DEFAULTS -,-,-,-" at the >>> beginning of action.action1, then that is certainly your choice. But I >>> know what I would choose to do. >> So the patch you offered isn't allowing parameters to be omitted at the >> end and we are back to square one - glad we've cleared that one up. > > It does if you change the rules entry to: > > action1(one,two,three,) > > Next time you ask for a change late in my release cycle, the answer will > clearly be "No!" >
Patch attached. When IGNOREUNKNOWNVARIABLES=Yes, you can enter $345698764 if it strikes your fancy. Incidentally, you can enter @345698764 without this patch and the compiler won't complain. -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 4841241..545317a 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -2933,13 +2933,14 @@ sub expand_variables( \$ ) {
if ( $var =~ /^\d+$/ ) {
fatal_error "Action parameters (\$$var) may only be referenced within the body of an action" unless $chain;
- unless ( $config{IGNOREUNKNOWNVARIABLES} ) {
+ if ( $config{IGNOREUNKNOWNVARIABLES} ) {
+ fatal_error "Invalid action parameter (\$$var)" if ( length( $var ) > 1 && $var =~ /^0/ );
+ } else {
fatal_error "Undefined parameter (\$$var)" unless ( defined $actparms{$var} &&
( length( $var ) == 1 ||
$var !~ /^0/ ) );
}
- fatal_error "Invalid action parameter (\$$var)" if ( ! defined $actparms{$var} ) || ( length( $var ) > 1 && $var =~ /^0/ );
$val = $var ? $actparms{$var} : $actparms{0}->{name};
} elsif ( exists $variables{$var} ) {
$val = $variables{$var};
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________ Shorewall-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-devel
