mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-23 11:11:32 +02:00
Expand shell variables in macro files; correct export of temp dir name
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5480 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
e05de0dd42
commit
46a97b0a0a
@ -3435,6 +3435,12 @@ sub finish_section ( $ ) {
|
|||||||
|
|
||||||
sub process_rule1 ( $$$$$$$$$ );
|
sub process_rule1 ( $$$$$$$$$ );
|
||||||
|
|
||||||
|
sub expand_shell_variables( $ ) {
|
||||||
|
my $line = $_[0];
|
||||||
|
$line = $1 . $ENV{$2} . $3 while $line =~ /^(.*?)\$([a-zA-Z]\w*\b)(.*)$/;
|
||||||
|
$line;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Expand a macro rule from the rules file
|
# Expand a macro rule from the rules file
|
||||||
#
|
#
|
||||||
@ -3451,6 +3457,7 @@ sub process_macro ( $$$$$$$$$$$ ) {
|
|||||||
next if $line =~ /^\s*$/;
|
next if $line =~ /^\s*$/;
|
||||||
$line =~ s/\s+/ /g;
|
$line =~ s/\s+/ /g;
|
||||||
$line =~ s/#.*$//;
|
$line =~ s/#.*$//;
|
||||||
|
$line = expand_shell_variables $line unless $macrofile =~ /^($env{SHAREDIR})/;
|
||||||
|
|
||||||
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split /\s+/, $line;
|
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split /\s+/, $line;
|
||||||
|
|
||||||
@ -4208,6 +4215,7 @@ sub process_action3( $$$$$ ) {
|
|||||||
next if $line =~ /^\s*$/;
|
next if $line =~ /^\s*$/;
|
||||||
$line =~ s/\s+/ /g;
|
$line =~ s/\s+/ /g;
|
||||||
$line =~ s/#.*$//;
|
$line =~ s/#.*$//;
|
||||||
|
$line = expand_shell_variables $line unless $actionfile =~ /^($env{SHAREDIR})/;
|
||||||
|
|
||||||
my ($target, $source, $dest, $proto, $ports, $sports, $rate, $user , $extra ) = split /\s+/, $line;
|
my ($target, $source, $dest, $proto, $ports, $sports, $rate, $user , $extra ) = split /\s+/, $line;
|
||||||
|
|
||||||
@ -4246,6 +4254,7 @@ sub process_action3( $$$$$ ) {
|
|||||||
next if $line =~ /^\s*$/;
|
next if $line =~ /^\s*$/;
|
||||||
$line =~ s/\s+/ /g;
|
$line =~ s/\s+/ /g;
|
||||||
$line =~ s/#.*$//;
|
$line =~ s/#.*$//;
|
||||||
|
$line = expand_shell_variables $line unless $actionfile =~ /^($env{SHAREDIR})/;
|
||||||
|
|
||||||
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split /\s+/, $line;
|
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split /\s+/, $line;
|
||||||
|
|
||||||
|
@ -2174,7 +2174,7 @@ do_initialize() {
|
|||||||
strip_file tos
|
strip_file tos
|
||||||
strip_file_and_lib_load tunnels tunnels
|
strip_file_and_lib_load tunnels tunnels
|
||||||
report_capabilities1 > $TMP_DIR/capabilities
|
report_capabilities1 > $TMP_DIR/capabilities
|
||||||
export $TMP_DIR
|
export TMP_DIR
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Clear $FW
|
# Clear $FW
|
||||||
|
Loading…
x
Reference in New Issue
Block a user