forked from extern/shorewall_code
Remove dependency on TMP_DIR
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5787 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
f9c81d5376
commit
56741f6152
@ -228,10 +228,8 @@ my @openstack;
|
||||
my $currentfile;
|
||||
my $currentfilename;
|
||||
my $currentlinenumber = 0;
|
||||
my $tmp_dir;
|
||||
|
||||
INIT {
|
||||
$tmp_dir = $ENV{TMP_DIR};
|
||||
@config_path = split /:/, $ENV{CONFIG_PATH};
|
||||
|
||||
for ( @config_path ) {
|
||||
@ -623,6 +621,8 @@ sub get_configuration( $ ) {
|
||||
|
||||
my $uid = `id -u`;
|
||||
|
||||
fatal_error "Command 'id -u' failed" unless $? == 0;
|
||||
|
||||
chomp $uid;
|
||||
|
||||
if ( ! $export && $uid == 0 ) {
|
||||
@ -639,9 +639,12 @@ sub get_configuration( $ ) {
|
||||
} else {
|
||||
fatal_error "The -e flag requires a capabilities file" unless open_file 'capabilities';
|
||||
}
|
||||
|
||||
#
|
||||
# If we successfully called open_file above, then this loop will read the capabilities file.
|
||||
# Otherwise, the first call to read_a_line() below will return false
|
||||
#
|
||||
while ( read_a_line ) {
|
||||
if ( $line =~ /^\s*([a-zA-Z]\w*)=(.*?)\s*$/ ) {
|
||||
if ( $line =~ /^([a-zA-Z]\w*)=(.*)$/ ) {
|
||||
my ($var, $val) = ($1, $2);
|
||||
unless ( exists $capabilities{$var} ) {
|
||||
warning_message "Unknown capability \"$var\" ignored";
|
||||
@ -650,7 +653,7 @@ sub get_configuration( $ ) {
|
||||
|
||||
$capabilities{$var} = $val =~ /^\"([^\"]*)\"$/ ? $1 : $val;
|
||||
} else {
|
||||
fatal_error "Unrecognized entry";
|
||||
fatal_error "Unrecognized capabilities entry";
|
||||
}
|
||||
}
|
||||
|
||||
@ -889,12 +892,4 @@ sub generate_aux_config() {
|
||||
|
||||
}
|
||||
|
||||
END {
|
||||
if ( $tmp_dir ) {
|
||||
my $exitstatus = $?; #Changed by system()
|
||||
system "rm -rf $tmp_dir";
|
||||
$? = $exitstatus;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -32,9 +32,6 @@
|
||||
# SHOREWALL_DIR A directory name was passed to /sbin/shorewall
|
||||
# VERBOSE Standard Shorewall verbosity control.
|
||||
# VERSION Shorewall Version
|
||||
# TMP_DIR Temporary Directory containing stripped copies
|
||||
# of all configuration files. Shell variable substitution
|
||||
# has been performed on these files.
|
||||
# TIMESTAMP=Yes -t option specified to /sbin/shorewall
|
||||
# FW Firewall zone (for shell-variable expansion).
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user