forked from extern/shorewall_code
Generate normalized name in process_rule_common()
This commit is contained in:
parent
21166e07f3
commit
4573b5ba8e
@ -138,11 +138,12 @@ sub get_target_param( $ ) {
|
|||||||
#
|
#
|
||||||
# Create a normalized action name from the passed pieces
|
# Create a normalized action name from the passed pieces
|
||||||
#
|
#
|
||||||
sub normalize_action( $$ ) {
|
sub normalize_action( $$$ ) {
|
||||||
my $target = shift;
|
my $action = shift;
|
||||||
|
my $level = shift;
|
||||||
my $param = shift;
|
my $param = shift;
|
||||||
|
|
||||||
my ($action, $level, $tag ) = split /:/, $target;
|
( $level, my $tag ) = split ':', $level;
|
||||||
|
|
||||||
$level = 'none' unless defined $level && $level ne '';
|
$level = 'none' unless defined $level && $level ne '';
|
||||||
$tag = '' unless defined $tag;
|
$tag = '' unless defined $tag;
|
||||||
@ -151,7 +152,7 @@ sub normalize_action( $$ ) {
|
|||||||
( $action, $level, $tag, $param );
|
( $action, $level, $tag, $param );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub normalize_action_name( $$ ) {
|
sub normalize_action_name( $$$ ) {
|
||||||
join (':', &normalize_action( @_ ) );
|
join (':', &normalize_action( @_ ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ sub process_actions2 () {
|
|||||||
while ( $changed ) {
|
while ( $changed ) {
|
||||||
$changed = 0;
|
$changed = 0;
|
||||||
for my $target (keys %usedactions) {
|
for my $target (keys %usedactions) {
|
||||||
my ($action, $level) = split_action $target;
|
my ( $action, $level, $tag, $param ) = split_action $target;
|
||||||
my $actionref = $actions{$action};
|
my $actionref = $actions{$action};
|
||||||
assert( $actionref );
|
assert( $actionref );
|
||||||
for my $action1 ( keys %{$actionref->{requires}} ) {
|
for my $action1 ( keys %{$actionref->{requires}} ) {
|
||||||
@ -581,10 +581,7 @@ sub process_actions3 () {
|
|||||||
|
|
||||||
for my $wholeaction ( keys %usedactions ) {
|
for my $wholeaction ( keys %usedactions ) {
|
||||||
my $chainref = find_logactionchain $wholeaction;
|
my $chainref = find_logactionchain $wholeaction;
|
||||||
my ( $action, $level, $tag ) = split /:/, $wholeaction;
|
my ( $action, $level, $tag, $param ) = split /:/, $wholeaction;
|
||||||
|
|
||||||
$level = '' unless defined $level;
|
|
||||||
$tag = '' unless defined $tag;
|
|
||||||
|
|
||||||
if ( $targets{$action} & BUILTIN ) {
|
if ( $targets{$action} & BUILTIN ) {
|
||||||
$level = '' if $level =~ /none!?/;
|
$level = '' if $level =~ /none!?/;
|
||||||
@ -738,6 +735,7 @@ sub process_rule_common ( $$$$$$$$$$$$$$$$ ) {
|
|||||||
my $optimize = $wildcard ? ( $basictarget =~ /!$/ ? 0 : $config{OPTIMIZE} & 1 ) : 0;
|
my $optimize = $wildcard ? ( $basictarget =~ /!$/ ? 0 : $config{OPTIMIZE} & 1 ) : 0;
|
||||||
my $inaction1;
|
my $inaction1;
|
||||||
my $inaction3;
|
my $inaction3;
|
||||||
|
my $normalized_target = normalize_action_name( $basictarget, $loglevel, $param );
|
||||||
|
|
||||||
if ( defined $chainref ) {
|
if ( defined $chainref ) {
|
||||||
if ( reftype $chainref ) {
|
if ( reftype $chainref ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user