mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 23:53:30 +01:00
Correct handling of default-action macro when specified as "macro.Name"
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
629717f7cc
commit
fb3194d96b
@ -361,10 +361,12 @@ sub process_a_policy() {
|
|||||||
$default = supplied $param ? normalize_action( $def, 'none', $param ) : normalize_action_name $def;
|
$default = supplied $param ? normalize_action( $def, 'none', $param ) : normalize_action_name $def;
|
||||||
use_policy_action( $default );
|
use_policy_action( $default );
|
||||||
} elsif ( find_macro( $def ) ) {
|
} elsif ( find_macro( $def ) ) {
|
||||||
$default = join( '.', 'macro', $def ) unless $default =~ /^macro./;
|
$def = join( '.', 'macro', $def ) unless $default =~ /^macro./;
|
||||||
if ( supplied $param ) {
|
if ( supplied $param ) {
|
||||||
validate_level($param);
|
validate_level($param);
|
||||||
$default = join( ':', $default, $param );
|
$default = join( ':', $def, $param );
|
||||||
|
} else {
|
||||||
|
$default = $def;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Unknown Default Action ($default)";
|
fatal_error "Unknown Default Action ($default)";
|
||||||
@ -1151,7 +1153,10 @@ sub merge_levels ($$) {
|
|||||||
sub find_macro( $ )
|
sub find_macro( $ )
|
||||||
{
|
{
|
||||||
my $macro = $_[0];
|
my $macro = $_[0];
|
||||||
my $macrofile = find_file( $macro =~ /^macro\./ ? $macro : "macro.$macro" );
|
|
||||||
|
$macro =~ s/^macro.//;
|
||||||
|
|
||||||
|
my $macrofile = find_file "macro.$macro";
|
||||||
|
|
||||||
if ( -f $macrofile ) {
|
if ( -f $macrofile ) {
|
||||||
$macros{$macro} = $macrofile;
|
$macros{$macro} = $macrofile;
|
||||||
|
@ -125,8 +125,8 @@
|
|||||||
|
|
||||||
<para>Both actions and macros can have parameters specified. In the
|
<para>Both actions and macros can have parameters specified. In the
|
||||||
case of a macro, only one parameter is allowed and specifies the log
|
case of a macro, only one parameter is allowed and specifies the log
|
||||||
level to be applied to each rule in the action; not recommended for
|
level to be applied to each bare LOG rule (e.g., a rule specifying
|
||||||
use.</para>
|
'LOG' with no level or tag in the ACTION column).</para>
|
||||||
|
|
||||||
<para>Possible actions are:</para>
|
<para>Possible actions are:</para>
|
||||||
|
|
||||||
|
@ -125,8 +125,8 @@
|
|||||||
|
|
||||||
<para>Both actions and macros can have parameters specified. In the
|
<para>Both actions and macros can have parameters specified. In the
|
||||||
case of a macro, only one parameter is allowed and specifies the log
|
case of a macro, only one parameter is allowed and specifies the log
|
||||||
level to be applied to each rule in the action; not recommended for
|
level to be applied to each bare LOG rule (e.g., a rule specifying
|
||||||
use.</para>
|
'LOG' with no level or tag in the ACTION column).</para>
|
||||||
|
|
||||||
<para>Possible actions are:</para>
|
<para>Possible actions are:</para>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user