mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 07:08:53 +01:00
Don't expand single-quoted .conf option values
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
0b431aa8c1
commit
05103bacd0
@ -669,16 +669,10 @@ sub initialize( $ ) {
|
|||||||
$debug = 0;
|
$debug = 0;
|
||||||
$confess = 0;
|
$confess = 0;
|
||||||
|
|
||||||
%params = ( root => '',
|
%params = ();
|
||||||
system => '',
|
|
||||||
command => '',
|
|
||||||
files => '',
|
|
||||||
destination => '' );
|
|
||||||
|
|
||||||
%compiler_params = ();
|
%compiler_params = ();
|
||||||
|
|
||||||
$compiler_params{$_} = 1 for keys %params;
|
|
||||||
|
|
||||||
@actparms = ();
|
@actparms = ();
|
||||||
|
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
@ -3037,9 +3031,9 @@ sub process_shorewall_conf( $$ ) {
|
|||||||
|
|
||||||
first_entry "Processing $file...";
|
first_entry "Processing $file...";
|
||||||
#
|
#
|
||||||
# Don't expand shell variables if $update
|
# Don't expand shell variables or allow embedded scripting
|
||||||
#
|
#
|
||||||
while ( read_a_line( 0,! $update ) ) {
|
while ( read_a_line( 0, 0 ) ) {
|
||||||
if ( $currentline =~ /^\s*([a-zA-Z]\w*)=(.*?)\s*$/ ) {
|
if ( $currentline =~ /^\s*([a-zA-Z]\w*)=(.*?)\s*$/ ) {
|
||||||
my ($var, $val) = ($1, $2);
|
my ($var, $val) = ($1, $2);
|
||||||
|
|
||||||
@ -3060,14 +3054,15 @@ sub process_shorewall_conf( $$ ) {
|
|||||||
#
|
#
|
||||||
# Now update the config file if asked
|
# Now update the config file if asked
|
||||||
#
|
#
|
||||||
if ( $update ) {
|
update_config_file( $annotate) if $update;
|
||||||
update_config_file( $annotate) if $update;
|
#
|
||||||
#
|
# Config file update requires that the option values not have
|
||||||
# Config file update requires that the option values not have
|
# Shell variables expanded. We do that now.
|
||||||
# Shell variables expanded. We do that now.
|
#
|
||||||
#
|
for ( values %config ) {
|
||||||
supplied $_ && expand_variables( $_ ) for values %config;
|
if ( supplied $_ ) {
|
||||||
|
expand_variables( $_ ) unless /$'(.+)'$/;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user