Don't export SHOREWALL_DIR

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5074 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-12-10 01:03:03 +00:00
parent fb6aec7f07
commit 12ac2a0ab6
3 changed files with 28 additions and 45 deletions

View File

@ -835,7 +835,7 @@ ensure_config_path() {
} }
# #
# Find a File -- For relative file name, look in ${SHOREWALL_DIR} then each ${CONFIG_PATH} then ${CONFDIR} # Find a File -- For relative file name, look in each ${CONFIG_PATH} then ${CONFDIR}
# #
find_file() find_file()
{ {
@ -846,18 +846,14 @@ find_file()
echo $1 echo $1
;; ;;
*) *)
if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then for directory in $(split $CONFIG_PATH); do
echo $SHOREWALL_DIR/$1 if [ -f $directory/$1 ]; then
else echo $directory/$1
for directory in $(split $CONFIG_PATH); do return
if [ -f $directory/$1 ]; then fi
echo $directory/$1 done
return
fi
done
echo ${CONFDIR}/$1 echo ${CONFDIR}/$1
fi
;; ;;
esac esac
} }

View File

@ -1,4 +1,4 @@
#!/bin/sh !/bin/sh
# #
# Shorewall Packet Filtering Firewall Control Program - V3.3 # Shorewall Packet Filtering Firewall Control Program - V3.3
# #
@ -124,6 +124,7 @@ get_config() {
# #
# This block is avoided for compile for export and when the user isn't root # This block is avoided for compile for export and when the user isn't root
# #
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:CONFIG_PATH
export CONFIG_PATH export CONFIG_PATH
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages [ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
@ -293,8 +294,7 @@ start_command() {
fi fi
fi fi
SHOREWALL_DIR=$1 CONFIG_PATH=$1:$CONFIG_PATH
export SHOREWALL_DIR
;; ;;
*) *)
usage 1 usage 1
@ -397,8 +397,7 @@ compile_command() {
fi fi
fi fi
SHOREWALL_DIR=$1 CONFIG_PATH=$1:$CONFIG_PATH
export SHOREWALL_DIR
file=$2 file=$2
;; ;;
*) *)
@ -462,8 +461,7 @@ check_command() {
fi fi
fi fi
SHOREWALL_DIR=$1 CONFIG_PATH=$1:$CONFIG_PATH
export SHOREWALL_DIR
;; ;;
*) *)
usage 1 usage 1
@ -526,8 +524,7 @@ restart_command() {
fi fi
fi fi
SHOREWALL_DIR=$1 CONFIG_PATH=$1:$CONFIG_PATH
export SHOREWALL_DIR
;; ;;
*) *)
usage 1 usage 1
@ -674,8 +671,7 @@ safe_commands() {
fi fi
fi fi
SHOREWALL_DIR=$1 CONFIG_PATH=$1:$CONFIG_PATH
export SHOREWALL_DIR
;; ;;
*) *)
usage 1 usage 1
@ -771,8 +767,7 @@ try_command() {
fi fi
fi fi
SHOREWALL_DIR=$1 CONFIG_PATH=$1:$CONFIG_PATH
export SHOREWALL_DIR
} }
while [ $finished -eq 0 -a $# -gt 0 ]; do while [ $finished -eq 0 -a $# -gt 0 ]; do
@ -934,7 +929,7 @@ reload_command() # $* = original arguments less the command.
esac esac
if [ -z "$getcaps" ]; then if [ -z "$getcaps" ]; then
SHOREWALL_DIR=$directory CONFIG_PATH=$directory:$CONFIG_PATH
capabilities=$(find_file capabilities) capabilities=$(find_file capabilities)
[ -f $capabilities ] || getcaps=Yes [ -f $capabilities ] || getcaps=Yes
fi fi
@ -1178,11 +1173,12 @@ while [ $finished -eq 0 ]; do
esac esac
done done
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
usage 1 usage 1
fi fi
[ -n "$SHOREWALL_DIR" ] && export SHOREWALL_DIR
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
MUTEX_TIMEOUT= MUTEX_TIMEOUT=

View File

@ -1,7 +1,6 @@
#! /bin/sh #! /bin/sh
# #
# Script for use from Perl to strip config files and perform shell variable # Script for use from Perl to strip config files and perform shell variable
# substitution.
# #
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm] # This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
# #
@ -25,10 +24,6 @@
# #
# Perform variable substitution on the passed argument and echo the result # Perform variable substitution on the passed argument and echo the result
# #
expand() # $@ = contents of variable which may be the name of another variable
{
eval echo \"$@\"
}
# #
# Read a file and handle "INCLUDE" directives # Read a file and handle "INCLUDE" directives
@ -47,7 +42,7 @@ read_file() # $1 = file name, $2 = nest count
echo " WARNING: INCLUDE in $1 ignored (nested too deeply)" >&2 echo " WARNING: INCLUDE in $1 ignored (nested too deeply)" >&2
fi fi
else else
echo "$(expand $first $rest)" eval echo \"$first $rest\"
fi fi
done < $1 done < $1
else else
@ -77,18 +72,14 @@ find_file()
echo $1 echo $1
;; ;;
*) *)
if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then for directory in $(split $CONFIG_PATH); do
echo $SHOREWALL_DIR/$1 if [ -f $directory/$1 ]; then
else echo $directory/$1
for directory in $(split $CONFIG_PATH); do return
if [ -f $directory/$1 ]; then fi
echo $directory/$1 done
return
fi echo ${CONFDIR}/$1
done
echo ${CONFDIR}/$1
fi
;; ;;
esac esac
} }