Don't expand single-quoted .conf option values

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-06-26 07:45:09 -07:00
parent 0b431aa8c1
commit 05103bacd0

View File

@ -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 /$'(.+)'$/;
}
} }
} }