Restore logic to make find_file() check for SHOREWALL_DIR

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1259 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2004-04-10 16:46:20 +00:00
parent e0e00293fe
commit 7763011f16
4 changed files with 19 additions and 20 deletions

View File

@ -9,3 +9,5 @@ Changes since 2.0.1
4) Implement CONFIG_PATH. 4) Implement CONFIG_PATH.
5) Apply Stijn Jonker's fix for CONFIG_PATH. 5) Apply Stijn Jonker's fix for CONFIG_PATH.
6) Restore logic to make 'find_file' check for SHOREWALL_DIR separately.

View File

@ -5740,8 +5740,6 @@ do_initialize() {
run_user_exit params run_user_exit params
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
config=$(find_file shorewall.conf) config=$(find_file shorewall.conf)
if [ -f $config ]; then if [ -f $config ]; then
@ -5755,7 +5753,6 @@ do_initialize() {
# Restore CONFIG_PATH if the shorewall.conf file cleared it # Restore CONFIG_PATH if the shorewall.conf file cleared it
# #
[ -n "$CONFIG_PATH" ] || CONFIG_PATH=/etc/shorewall:/usr/share/shorewall [ -n "$CONFIG_PATH" ] || CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
# #
# Determine the capabilities of the installed iptables/netfilter # Determine the capabilities of the installed iptables/netfilter
# #

View File

@ -94,19 +94,23 @@ find_file()
echo $1 echo $1
;; ;;
*) *)
saveifs=$IFS if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then
IFS=: echo $SHOREWALL_DIR/$1
for directory in $CONFIG_PATH; do else
if [ -f $directory/$1 ]; then saveifs=$IFS
echo $directory/$1 IFS=:
IFS=$saveifs for directory in $CONFIG_PATH; do
return if [ -f $directory/$1 ]; then
fi echo $directory/$1
done IFS=$saveifs
return
fi
done
IFS=$saveifs IFS=$saveifs
echo /etc/shorewall/$1 echo /etc/shorewall/$1
fi
;; ;;
esac esac
} }

View File

@ -632,7 +632,6 @@ FUNCTIONS=$SHARED_DIR/functions
VERSION_FILE=$SHARED_DIR/version VERSION_FILE=$SHARED_DIR/version
HELP=$SHARED_DIR/help HELP=$SHARED_DIR/help
CONFIG_PATH=/etc/shorewall:/usr/share/shorewall CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
if [ -f $FUNCTIONS ]; then if [ -f $FUNCTIONS ]; then
. $FUNCTIONS . $FUNCTIONS
@ -650,10 +649,7 @@ else
exit 2 exit 2
fi fi
if [ -z "$CONFIG_PATH" ]; then [ -z "$CONFIG_PATH" ] && CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
fi
[ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall [ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall