mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-25 23:19:03 +01:00
Make reserved name illegal for Actions
This commit is contained in:
parent
b4946dcf65
commit
011c90e6b8
@ -107,6 +107,7 @@ our %EXPORT_TAGS = (
|
|||||||
ecn_chain
|
ecn_chain
|
||||||
notrack_chain
|
notrack_chain
|
||||||
first_chains
|
first_chains
|
||||||
|
reserved_name
|
||||||
find_chain
|
find_chain
|
||||||
ensure_chain
|
ensure_chain
|
||||||
ensure_accounting_chain
|
ensure_accounting_chain
|
||||||
@ -1130,6 +1131,12 @@ sub first_chains( $ ) #$1 = interface
|
|||||||
( $c . '_fwd', $c . '_in' );
|
( $c . '_fwd', $c . '_in' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub reserved_name( $ ) {
|
||||||
|
my $chain = shift;
|
||||||
|
|
||||||
|
$builtin_target{$chain} || $config_files{$chain} || $chain =~ /^account(?:fwd|in|ing|out)$/;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a new chain and return a reference to it.
|
# Create a new chain and return a reference to it.
|
||||||
#
|
#
|
||||||
|
@ -192,6 +192,8 @@ sub new_action( $$ ) {
|
|||||||
|
|
||||||
my ( $action , $type ) = @_;
|
my ( $action , $type ) = @_;
|
||||||
|
|
||||||
|
fatal_error "Invalid action name( $action)" if reserved_name( $action );
|
||||||
|
|
||||||
$actions{$action} = { actchain => '' };
|
$actions{$action} = { actchain => '' };
|
||||||
|
|
||||||
$targets{$action} = $type;
|
$targets{$action} = $type;
|
||||||
|
Loading…
Reference in New Issue
Block a user