forked from extern/shorewall_code
Make reserved name illegal for Actions
This commit is contained in:
parent
b4946dcf65
commit
011c90e6b8
@ -107,6 +107,7 @@ our %EXPORT_TAGS = (
|
||||
ecn_chain
|
||||
notrack_chain
|
||||
first_chains
|
||||
reserved_name
|
||||
find_chain
|
||||
ensure_chain
|
||||
ensure_accounting_chain
|
||||
@ -1130,6 +1131,12 @@ sub first_chains( $ ) #$1 = interface
|
||||
( $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.
|
||||
#
|
||||
|
@ -192,6 +192,8 @@ sub new_action( $$ ) {
|
||||
|
||||
my ( $action , $type ) = @_;
|
||||
|
||||
fatal_error "Invalid action name( $action)" if reserved_name( $action );
|
||||
|
||||
$actions{$action} = { actchain => '' };
|
||||
|
||||
$targets{$action} = $type;
|
||||
|
Loading…
Reference in New Issue
Block a user