On 12/06/2012 08:16 AM, Tom Eastep wrote:
On 12/05/2012 05:34 PM, Mr Dash Four wrote:
I'll be able to do a bit of testing after Tuesday.
This is what I was able to find out so far:
1.
action.my_log
~~~~~~~~~~~~~
$1
rules
~~~~~
my_log(LOG:info(uid,tcp_options,ip_options,macdecode,tcp_sequence)):debug(uid,tcp_options,ip_options,macdecode,tcp_sequence)
$FW net
gets me "ERROR: Invalid ACTION (LOG:info(uid)"
Patch PARAM.patch attached.
My apologies -- that patch doesn't apply cleanly against RC 1. Patch
PARAM1.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 7190cd1265afa64eae632aa0258e99e3b279932f
Author: Tom Eastep <[email protected]>
Date: Thu Dec 6 15:20:10 2012 -0800
Handle nested parens when pushing action parameters.
- Add an optional argument to split_list1 that causes parens to be retained.
Signed-off-by: Tom Eastep <[email protected]>
Conflicts:
Shorewall/Perl/Shorewall/Config.pm
diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm
index 29ff0f9..1e0b31f 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -1652,8 +1652,8 @@ sub split_list( $$;$ ) {
split /,/, $list;
}
-sub split_list1( $$ ) {
- my ($list, $type ) = @_;
+sub split_list1( $$;$ ) {
+ my ($list, $type, $keepparens ) = @_;
fatal_error "Invalid $type list ($list)" if $list =~ /^,|,$|,,|!,|,!$/;
@@ -1666,17 +1666,17 @@ sub split_list1( $$ ) {
if ( ( $count = tr/(/(/ ) > 0 ) {
fatal_error "Invalid $type list ($list)" if $element || $count > 1;
- s/\(//;
+ s/\(// unless $keepparens;
if ( ( $count = tr/)/)/ ) > 0 ) {
fatal_error "Invalid $type list ($list)" if $count > 1;
- s/\)//;
+ s/\)// unless $keepparens;
push @list2 , $_;
} else {
$element = $_;
}
} elsif ( ( $count = tr/)/)/ ) > 0 ) {
fatal_error "Invalid $type list ($list)" unless $element && $count == 1;
- s/\)//;
+ s/\)// unless $keepparens;
push @list2, join ',', $element, $_;
$element = '';
} elsif ( $element ) {
@@ -2470,7 +2470,7 @@ sub embedded_perl( $ ) {
# Push/pop action params
#
sub push_action_params( $$ ) {
- my @params = split /,/, $_[1];
+ my @params = split_list1 $_[1], 'parameter', 1;
my @oldparams = @actparms;
@actparms = ();
diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm
index ffb87c2..52c13e3 100644
--- a/Shorewall/Perl/Shorewall/Rules.pm
+++ b/Shorewall/Perl/Shorewall/Rules.pm
@@ -1987,7 +1987,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$ ) {
return $generated;
} elsif ( $actiontype & ( ACTION | INLINE ) ) {
- split_list $param, 'Action parameter';
+ split_list1 $param, 'Action parameter';
} elsif ( $actiontype & NFQ ) {
require_capability( 'NFQUEUE_TARGET', 'NFQUEUE Rules', '' );
my $paramval = $param eq '' ? 0 : numeric_value( $param );
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel