mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-18 12:20:42 +01:00
Don't allow reserved variables to be set in params
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
dff5136134
commit
b2842ae8d4
@ -3381,6 +3381,8 @@ sub unsupported_yes_no_warning( $ ) {
|
|||||||
sub get_params() {
|
sub get_params() {
|
||||||
my $fn = find_file 'params';
|
my $fn = find_file 'params';
|
||||||
|
|
||||||
|
my %reserved = ( COMMAND => 1, CONFDIR => 1, SHAREDIR => 1, VARDIR => 1 );
|
||||||
|
|
||||||
if ( -f $fn ) {
|
if ( -f $fn ) {
|
||||||
progress_message2 "Processing $fn ...";
|
progress_message2 "Processing $fn ...";
|
||||||
|
|
||||||
@ -3484,6 +3486,11 @@ sub get_params() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for ( keys %params ) {
|
||||||
|
fatal_error "The variable name $_ is reserved and may not be set in the params file"
|
||||||
|
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
|
||||||
|
}
|
||||||
|
|
||||||
if ( $debug ) {
|
if ( $debug ) {
|
||||||
print "PARAMS:\n";
|
print "PARAMS:\n";
|
||||||
my $value;
|
my $value;
|
||||||
|
Loading…
Reference in New Issue
Block a user