mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-24 00:23:28 +01:00
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
|
||||
#
|
||||
sub normalize_action( $$ ) {
|
||||
my $target = shift;
|
||||
sub normalize_action( $$$ ) {
|
||||
my $action = shift;
|
||||
my $level = shift;
|
||||
my $param = shift;
|
||||
|
||||
my ($action, $level, $tag ) = split /:/, $target;
|
||||
( $level, my $tag ) = split ':', $level;
|
||||
|
||||
$level = 'none' unless defined $level && $level ne '';
|
||||
$tag = '' unless defined $tag;
|
||||
@ -151,7 +152,7 @@ sub normalize_action( $$ ) {
|
||||
( $action, $level, $tag, $param );
|
||||
}
|
||||
|
||||
sub normalize_action_name( $$ ) {
|
||||
sub normalize_action_name( $$$ ) {
|
||||
join (':', &normalize_action( @_ ) );
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ sub process_actions2 () {
|
||||
while ( $changed ) {
|
||||
$changed = 0;
|
||||
for my $target (keys %usedactions) {
|
||||
my ($action, $level) = split_action $target;
|
||||
my ( $action, $level, $tag, $param ) = split_action $target;
|
||||
my $actionref = $actions{$action};
|
||||
assert( $actionref );
|
||||
for my $action1 ( keys %{$actionref->{requires}} ) {
|
||||
@ -581,10 +581,7 @@ sub process_actions3 () {
|
||||
|
||||
for my $wholeaction ( keys %usedactions ) {
|
||||
my $chainref = find_logactionchain $wholeaction;
|
||||
my ( $action, $level, $tag ) = split /:/, $wholeaction;
|
||||
|
||||
$level = '' unless defined $level;
|
||||
$tag = '' unless defined $tag;
|
||||
my ( $action, $level, $tag, $param ) = split /:/, $wholeaction;
|
||||
|
||||
if ( $targets{$action} & BUILTIN ) {
|
||||
$level = '' if $level =~ /none!?/;
|
||||
@ -738,6 +735,7 @@ sub process_rule_common ( $$$$$$$$$$$$$$$$ ) {
|
||||
my $optimize = $wildcard ? ( $basictarget =~ /!$/ ? 0 : $config{OPTIMIZE} & 1 ) : 0;
|
||||
my $inaction1;
|
||||
my $inaction3;
|
||||
my $normalized_target = normalize_action_name( $basictarget, $loglevel, $param );
|
||||
|
||||
if ( defined $chainref ) {
|
||||
if ( reftype $chainref ) {
|
||||
|
Loading…
Reference in New Issue
Block a user