Allow variable expansion when processing shorewallrc.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2019-03-14 20:38:10 -07:00
parent e626b77097
commit 60f2f3b0d0
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -4075,14 +4075,16 @@ sub process_shorewallrc( $$ ) {
my ( $shorewallrc , $product ) = @_;
$shorewallrc{PRODUCT} = $product;
$variables{PRODUCT} = $product;
if ( open_file $shorewallrc ) {
while ( read_a_line( STRIP_COMMENTS | SUPPRESS_WHITESPACE | CHECK_GUNK ) ) {
while ( read_a_line( STRIP_COMMENTS | SUPPRESS_WHITESPACE | CHECK_GUNK | EXPAND_VARIABLES ) ) {
if ( $currentline =~ /^([a-zA-Z]\w*)=(.*)$/ ) {
my ($var, $val) = ($1, $2);
$val = $1 if $val =~ /^\"([^\"]*)\"$/;
expand_shorewallrc_variables($val) if supplied $val;
$shorewallrc{$var} = $val;
$variables{$var} = $val;
} else {
fatal_error "Unrecognized shorewallrc entry";
}