mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-10 15:48:13 +01:00
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:
parent
fb6aec7f07
commit
12ac2a0ab6
@ -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()
|
||||
{
|
||||
@ -846,18 +846,14 @@ find_file()
|
||||
echo $1
|
||||
;;
|
||||
*)
|
||||
if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then
|
||||
echo $SHOREWALL_DIR/$1
|
||||
else
|
||||
for directory in $(split $CONFIG_PATH); do
|
||||
if [ -f $directory/$1 ]; then
|
||||
echo $directory/$1
|
||||
return
|
||||
fi
|
||||
done
|
||||
for directory in $(split $CONFIG_PATH); do
|
||||
if [ -f $directory/$1 ]; then
|
||||
echo $directory/$1
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${CONFDIR}/$1
|
||||
fi
|
||||
echo ${CONFDIR}/$1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
!/bin/sh
|
||||
#
|
||||
# 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
|
||||
#
|
||||
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:CONFIG_PATH
|
||||
export CONFIG_PATH
|
||||
|
||||
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
|
||||
@ -293,8 +294,7 @@ start_command() {
|
||||
fi
|
||||
fi
|
||||
|
||||
SHOREWALL_DIR=$1
|
||||
export SHOREWALL_DIR
|
||||
CONFIG_PATH=$1:$CONFIG_PATH
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
@ -397,8 +397,7 @@ compile_command() {
|
||||
fi
|
||||
fi
|
||||
|
||||
SHOREWALL_DIR=$1
|
||||
export SHOREWALL_DIR
|
||||
CONFIG_PATH=$1:$CONFIG_PATH
|
||||
file=$2
|
||||
;;
|
||||
*)
|
||||
@ -462,8 +461,7 @@ check_command() {
|
||||
fi
|
||||
fi
|
||||
|
||||
SHOREWALL_DIR=$1
|
||||
export SHOREWALL_DIR
|
||||
CONFIG_PATH=$1:$CONFIG_PATH
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
@ -526,8 +524,7 @@ restart_command() {
|
||||
fi
|
||||
fi
|
||||
|
||||
SHOREWALL_DIR=$1
|
||||
export SHOREWALL_DIR
|
||||
CONFIG_PATH=$1:$CONFIG_PATH
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
@ -674,8 +671,7 @@ safe_commands() {
|
||||
fi
|
||||
fi
|
||||
|
||||
SHOREWALL_DIR=$1
|
||||
export SHOREWALL_DIR
|
||||
CONFIG_PATH=$1:$CONFIG_PATH
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
@ -771,8 +767,7 @@ try_command() {
|
||||
fi
|
||||
fi
|
||||
|
||||
SHOREWALL_DIR=$1
|
||||
export SHOREWALL_DIR
|
||||
CONFIG_PATH=$1:$CONFIG_PATH
|
||||
}
|
||||
|
||||
while [ $finished -eq 0 -a $# -gt 0 ]; do
|
||||
@ -934,7 +929,7 @@ reload_command() # $* = original arguments less the command.
|
||||
esac
|
||||
|
||||
if [ -z "$getcaps" ]; then
|
||||
SHOREWALL_DIR=$directory
|
||||
CONFIG_PATH=$directory:$CONFIG_PATH
|
||||
capabilities=$(find_file capabilities)
|
||||
[ -f $capabilities ] || getcaps=Yes
|
||||
fi
|
||||
@ -1178,11 +1173,12 @@ while [ $finished -eq 0 ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
[ -n "$SHOREWALL_DIR" ] && export SHOREWALL_DIR
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
MUTEX_TIMEOUT=
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# 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]
|
||||
#
|
||||
@ -25,10 +24,6 @@
|
||||
#
|
||||
# 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
|
||||
@ -47,7 +42,7 @@ read_file() # $1 = file name, $2 = nest count
|
||||
echo " WARNING: INCLUDE in $1 ignored (nested too deeply)" >&2
|
||||
fi
|
||||
else
|
||||
echo "$(expand $first $rest)"
|
||||
eval echo \"$first $rest\"
|
||||
fi
|
||||
done < $1
|
||||
else
|
||||
@ -77,18 +72,14 @@ find_file()
|
||||
echo $1
|
||||
;;
|
||||
*)
|
||||
if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then
|
||||
echo $SHOREWALL_DIR/$1
|
||||
else
|
||||
for directory in $(split $CONFIG_PATH); do
|
||||
if [ -f $directory/$1 ]; then
|
||||
echo $directory/$1
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${CONFDIR}/$1
|
||||
fi
|
||||
for directory in $(split $CONFIG_PATH); do
|
||||
if [ -f $directory/$1 ]; then
|
||||
echo $directory/$1
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${CONFDIR}/$1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user