Make ?...shell/perl directives case insensitive

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-06-20 10:39:39 -07:00
parent 4bd35a0b93
commit 71bcd11ab6
22 changed files with 60 additions and 60 deletions

View File

@ -2786,7 +2786,7 @@ sub embedded_shell( $ ) {
my $last = 0; my $last = 0;
while ( read_a_line( PLAIN_READ ) ) { while ( read_a_line( PLAIN_READ ) ) {
last if $last = $currentline =~ s/^\s*\??END(\s+SHELL)?\s*(?:;\s*)?$//; last if $last = $currentline =~ s/^\s*\??END(\s+SHELL)?\s*(?:;\s*)?$//i;
$command .= "$currentline\n"; $command .= "$currentline\n";
} }
@ -2820,7 +2820,7 @@ sub embedded_perl( $ ) {
my $last = 0; my $last = 0;
while ( read_a_line( PLAIN_READ ) ) { while ( read_a_line( PLAIN_READ ) ) {
last if $last = $currentline =~ s/^\s*\??END(\s+PERL)?\s*(?:;\s*)?//; last if $last = $currentline =~ s/^\s*\??END(\s+PERL)?\s*(?:;\s*)?//i;
$command .= "$currentline\n"; $command .= "$currentline\n";
} }
@ -3117,15 +3117,15 @@ sub read_a_line($) {
chop $currentline, next if ($currentline .= $_) =~ /\\$/; chop $currentline, next if ($currentline .= $_) =~ /\\$/;
# #
# Must check for shell/perl before doing variable expansion # Must check for shell/perl before doing variable expansion
# #
if ( $options & EMBEDDED_ENABLED ) { if ( $options & EMBEDDED_ENABLED ) {
if ( $currentline =~ s/^\s*\??(BEGIN\s+)SHELL\s*;?// || $currentline =~ s/^\s*\??SHELL\s*// ) { if ( $currentline =~ s/^\s*\??(BEGIN\s+)SHELL\s*;?//i || $currentline =~ s/^\s*\??SHELL\s*//i ) {
handle_first_entry if $first_entry; handle_first_entry if $first_entry;
embedded_shell( $1 ); embedded_shell( $1 );
next; next;
} }
if ( $currentline =~ s/^\s*\??(BEGIN\s+)PERL\s*;?// || $currentline =~ s/^\s*\??PERL\s*// ) { if ( $currentline =~ s/^\s*\??(BEGIN\s+)PERL\s*;?//i || $currentline =~ s/^\s*\??PERL\s*//i ) {
handle_first_entry if $first_entry; handle_first_entry if $first_entry;
embedded_perl( $1 ); embedded_perl( $1 );
next; next;

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP,- DEFAULTS DROP,-
?BEGIN PERL; ?begin perl;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
use Shorewall::Config; use Shorewall::Config;
@ -71,4 +71,4 @@ add_jump $chainref, $target, 0, '-d 224.0.0.0/4 ';
1; 1;
?END PERL; ?end perl;

View File

@ -28,12 +28,12 @@
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!! # IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
# #
############################################################################### ###############################################################################
?FORMAT 2 ?format 2
# #
# The following magic provides different defaults for @2 thru @5, when @1 is # The following magic provides different defaults for @2 thru @5, when @1 is
# 'audit'. # 'audit'.
# #
?BEGIN PERL; ?begin perl;
use Shorewall::Config; use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 ); my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
@ -50,7 +50,7 @@ if ( defined $p1 ) {
1; 1;
?END PERL; ?end perl;
DEFAULTS -,-,DROP,ACCEPT,DROP DEFAULTS -,-,DROP,ACCEPT,DROP

View File

@ -9,11 +9,11 @@
# audit = Audit dropped packets. # audit = Audit dropped packets.
# #
################################################################################# #################################################################################
?FORMAT 2 ?format 2
DEFAULTS - DEFAULTS -
?BEGIN PERL; ?begin perl;
use strict; use strict;
use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6); use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6);
use Shorewall::IPAddrs qw( IPv6_MULTICAST ); use Shorewall::IPAddrs qw( IPv6_MULTICAST );
@ -79,7 +79,7 @@ if ( $family == F_IPV4 ) {
add_ijump( $chainref, g => $target, s => IPv6_MULTICAST ); add_ijump( $chainref, g => $target, s => IPv6_MULTICAST );
} }
?END PERL; ?end perl;

View File

@ -27,11 +27,11 @@
# Default action is ACCEPT # Default action is ACCEPT
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS ACCEPT DEFAULTS ACCEPT
?BEGIN PERL; ?begin perl;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
use Shorewall::Config; use Shorewall::Config;
@ -46,4 +46,4 @@ if ( my $check = check_state( 'ESTABLISHED' ) ) {
1; 1;
?END PERL; ?end perl;

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP,- DEFAULTS DROP,-
?BEGIN PERL; ?begin perl;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
use Shorewall::Config; use Shorewall::Config;
@ -51,4 +51,4 @@ if ( my $check = check_state( 'INVALID' ) ) {
1; 1;
?END PERL; ?end perl;

View File

@ -27,11 +27,11 @@
# Default action is ACCEPT # Default action is ACCEPT
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS ACCEPT DEFAULTS ACCEPT
?BEGIN PERL; ?begin perl;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
use Shorewall::Config; use Shorewall::Config;
@ -46,4 +46,4 @@ if ( my $check = check_state( 'NEW' ) ) {
1; 1;
?END PERL; ?end perl;

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP,- DEFAULTS DROP,-
?BEGIN PERL; ?begin perl;
use strict; use strict;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
@ -50,4 +50,4 @@ perl_action_tcp_helper( $action, '-p 6 ! --syn' );
1; 1;
?END PERL; ?end perl;

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP,- DEFAULTS DROP,-
?BEGIN PERL; ?begin perl;
use Shorewall::Config; use Shorewall::Config;
use Shorewall::Chains; use Shorewall::Chains;
@ -48,4 +48,4 @@ perl_action_tcp_helper( $action, '-p 6 --tcp-flags RST RST' );
1; 1;
?END PERL; ?end perl;

View File

@ -27,12 +27,12 @@
# #
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!! # IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
############################################################################### ###############################################################################
?FORMAT 2 ?format 2
# #
# The following magic provides different defaults for @2 thru @5, when @1 is # The following magic provides different defaults for @2 thru @5, when @1 is
# 'audit'. # 'audit'.
# #
?BEGIN PERL; ?begin perl;
use Shorewall::Config; use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 ); my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
@ -49,7 +49,7 @@ if ( defined $p1 ) {
1; 1;
?END PERL; ?end perl;
DEFAULTS -,-,REJECT,ACCEPT,DROP DEFAULTS -,-,REJECT,ACCEPT,DROP

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP DEFAULTS DROP
?BEGIN PERL; ?begin perl;
use strict; use strict;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
@ -47,4 +47,4 @@ if ( my $check = check_state( 'RELATED' ) ) {
1; 1;
?END PERL; ?end perl;

View File

@ -9,11 +9,11 @@
# audit = Audit dropped packets. # audit = Audit dropped packets.
# #
################################################################################# #################################################################################
?FORMAT 2 ?format 2
DEFAULTS - DEFAULTS -
?BEGIN PERL; ?begin perl;
use strict; use strict;
use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6); use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6);
use Shorewall::Chains; use Shorewall::Chains;
@ -34,7 +34,7 @@ perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,RST SYN,RST' );
perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,FIN SYN,FIN' ); perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,FIN SYN,FIN' );
perl_action_tcp_helper( $action, '-p tcp --syn --sport 0' ); perl_action_tcp_helper( $action, '-p tcp --syn --sport 0' );
?END PERL; ?end perl;

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP DEFAULTS DROP
?BEGIN PERL; ?begin perl;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
use Shorewall::Config; use Shorewall::Config;
@ -46,4 +46,4 @@ if ( my $check = check_state( 'UNTRACKED' ) ) {
1; 1;
?END PERL; ?end perl;

View File

@ -25,11 +25,11 @@
# allowInvalid[([audit])] # allowInvalid[([audit])]
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS - DEFAULTS -
?BEGIN PERL; ?begin perl;
use strict; use strict;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
@ -50,4 +50,4 @@ perl_action_helper( "Invalid($action)", '' );
1; 1;
?END PERL; ?end perl;

View File

@ -25,11 +25,11 @@
# dropInvalid[([audit])] # dropInvalid[([audit])]
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS - DEFAULTS -
?BEGIN PERL; ?begin perl;
use strict; use strict;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
@ -50,4 +50,4 @@ perl_action_helper( "Invalid($action)", '' );
1; 1;
?END PERL; ?end perl;

View File

@ -20,7 +20,7 @@
# #
####################################################################################################### #######################################################################################################
# DO NOT REMOVE THE FOLLOWING LINE # DO NOT REMOVE THE FOLLOWING LINE
?FORMAT 2 ?format 2
################################################################################################################################################################################################# #################################################################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER #ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP # PORT PORT(S) DEST LIMIT GROUP

View File

@ -8,7 +8,7 @@
############################################################################### ###############################################################################
#TARGET SOURCE DEST PROTO DEST #TARGET SOURCE DEST PROTO DEST
# PORT(S) # PORT(S)
?COMMENT Needed ICMP types (RFC4890) ?comment Needed ICMP types (RFC4890)
A_ACCEPT - - ipv6-icmp destination-unreachable A_ACCEPT - - ipv6-icmp destination-unreachable
A_ACCEPT - - ipv6-icmp packet-too-big A_ACCEPT - - ipv6-icmp packet-too-big

View File

@ -9,7 +9,7 @@
#TARGET SOURCE DEST PROTO DEST #TARGET SOURCE DEST PROTO DEST
# PORT(S) # PORT(S)
?FORMAT 2 ?format 2
DEFAULTS ACCEPT DEFAULTS ACCEPT
?COMMENT Needed ICMP types (RFC4890) ?COMMENT Needed ICMP types (RFC4890)

View File

@ -27,11 +27,11 @@
# Default action is DROP # Default action is DROP
# #
########################################################################################## ##########################################################################################
?FORMAT 2 ?format 2
DEFAULTS DROP,- DEFAULTS DROP,-
?BEGIN PERL; ?begin perl;
use Shorewall::IPAddrs; use Shorewall::IPAddrs;
use Shorewall::Config; use Shorewall::Config;
@ -68,4 +68,4 @@ add_jump $chainref, $target, 0, join( ' ', '-d', IPv6_MULTICAST . ' ' );
1; 1;
?END PERL; ?end perl;

View File

@ -31,12 +31,12 @@
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!! # IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
# #
############################################################################### ###############################################################################
?FORMAT 2 ?format 2
# #
# The following magic provides different defaults for $2 thru $5, when $1 is # The following magic provides different defaults for $2 thru $5, when $1 is
# 'audit'. # 'audit'.
# #
?BEGIN PERL; ?begin perl;
use Shorewall::Config; use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 ); my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
@ -54,7 +54,7 @@ if ( defined $p1 ) {
1; 1;
?END PERL; ?end perl;
DEFAULTS -,REJECT,DROP,ACCEPT,DROP DEFAULTS -,REJECT,DROP,ACCEPT,DROP

View File

@ -27,12 +27,12 @@
# #
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!! # IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
############################################################################### ###############################################################################
?FORMAT 2 ?format 2
# #
# The following magic provides different defaults for $2 thru $5, when $1 is # The following magic provides different defaults for $2 thru $5, when $1 is
# 'audit'. # 'audit'.
# #
?BEGIN PERL; ?begin perl;
use Shorewall::Config; use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 ); my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
@ -50,7 +50,7 @@ if ( defined $p1 ) {
1; 1;
?END PERL; ?end perl;
DEFAULTS -,REJECT,REJECT,ACCEPT,DROP DEFAULTS -,REJECT,REJECT,ACCEPT,DROP

View File

@ -20,7 +20,7 @@
# #
####################################################################################################### #######################################################################################################
# DO NOT REMOVE THE FOLLOWING LINE # DO NOT REMOVE THE FOLLOWING LINE
?FORMAT 2 ?format 2
##################################################################################################################################################################################### #####################################################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER #ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
# PORT PORT(S) DEST LIMIT GROUP # PORT PORT(S) DEST LIMIT GROUP