From cd5409d633550e22a5495eb2ca63f11b097668a2 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 6 Jul 2020 15:38:01 -0700 Subject: [PATCH] Take care of '$LOG_LEVEL' during update Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 7c371c8c9..0a8905cfb 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -4413,7 +4413,9 @@ sub validate_level( $;$ ) { sub default_log_level( $$ ) { my ( $level, $default ) = @_; - my $value = $config{$level}; + my $value = $config{$level} || ''; + + $value = $config{LOG_LEVEL} if $value eq '$LOG_LEVEL'; #This can happen during update unless ( supplied $value ) { $config{$level} = validate_level $default, $level; @@ -6836,6 +6838,12 @@ sub get_configuration( $$$ ) { require_capability 'AUDIT_TARGET', "SMURF_DISPOSITION=$val", 's' if $val =~ /^A_/; + if ( supplied( $val = $config{LOG_LEVEL} ) ) { + validate_level( $val ); + } else { + $config{LOG_LEVEL} = 'info'; + } + default_log_level 'BLACKLIST_LOG_LEVEL', ''; default_log_level 'MACLIST_LOG_LEVEL', ''; default_log_level 'TCP_FLAGS_LOG_LEVEL', ''; @@ -6844,12 +6852,6 @@ sub get_configuration( $$$ ) { default_log_level 'INVALID_LOG_LEVEL', ''; default_log_level 'UNTRACKED_LOG_LEVEL', ''; - if ( supplied( $val = $config{LOG_LEVEL} ) ) { - validate_level( $val ); - } else { - $config{LOG_LEVEL} = 'info'; - } - if ( supplied( $val = $config{LOG_BACKEND} ) ) { if ( $family == F_IPV4 && $val eq 'ULOG' ) { $val = 'ipt_ULOG';