From a50c52675b85e0098c2ad672d8f82894410f3177 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 12 Mar 2016 15:08:04 -0800 Subject: [PATCH] Correct a comment Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 2 +- docs/configuration_file_basics.xml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index b21dc3518..a187a7c62 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -936,7 +936,7 @@ sub set_rule_option( $$$ ) { # # Shorewall::Rules::perl_action_tcp_helper() can produce rules that have two -p specifications. # The first will have a modifier like '! --syn' while the second will not. We want to retain - # the first while + # the first one. if ( $option eq 'p' ) { my ( $proto ) = split( ' ', $ruleref->{p} ); return if $proto eq $value; diff --git a/docs/configuration_file_basics.xml b/docs/configuration_file_basics.xml index 8d072bd18..2cd56abab 100644 --- a/docs/configuration_file_basics.xml +++ b/docs/configuration_file_basics.xml @@ -2168,6 +2168,31 @@ SSH(ACCEPT) net:$MYIP $FW <lines to be included if all three expressions evaluate to false. ?ENDIF + + Beginning in Shorewall 5.0.7, an error can be raised using the + ?ERROR directive: + + ?ERROR message + + Variables in the message are evaluated and the result appears in a + standard Shorewall ERROR: message. + + Example from the 5.0.7 action.GlusterFS: + + ?if @1 !~ /^\d+/ || ! @1 || @1 > 1024 + ?error Invalid value for Bricks (@1) +?elsif @2 !~ /^[01]$/ + ?error Invalid value for IB (@2) +?endif + + + The above code insures that the first action paramater is a non-zero + number <= 1024 and that the second parameter is either 0 or 1. If 2000 + is passed for the first parameter, the following error message is + generated: + + ERROR: Invalid value for Bricks (2000) /usr/share/shorewall/action.GlusterFS (line 15) + from /etc/shorewall/rules (line 45)