From 9d299ef8666750c42dfd99edb68f50ccb3dcb9bd Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 14 Nov 2017 08:50:05 -0800 Subject: [PATCH] Don't verify IP and SHOREWALL_SHELL setting when compiling for export Signed-off-by: Tom Eastep --- Shorewall/lib.cli-std | 47 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index f425381ce..f7885346e 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -211,30 +211,35 @@ get_config() { LOG_VERBOSITY=-1 fi - if [ -n "$SHOREWALL_SHELL" -a -z "$g_export" ]; then - if [ ! -x "$SHOREWALL_SHELL" ]; then - echo " WARNING: The program specified in SHOREWALL_SHELL does not exist or is not executable; falling back to /bin/sh" >&2 - SHOREWALL_SHELL=/bin/sh + if [ -z "$g_export" -a "$(id -u)" = 0 ]; then + if [ -n "$SHOREWALL_SHELL" -a -z "$g_export" ]; then + if [ ! -x "$SHOREWALL_SHELL" ]; then + echo " WARNING: The program specified in SHOREWALL_SHELL does not exist or is not executable; falling back to /bin/sh" >&2 + SHOREWALL_SHELL=/bin/sh + fi fi - fi - if [ -n "$IP" ]; then - case "$IP" in - */*) - if [ ! -x "$IP" ] ; then - fatal_error "The program specified in IP ($IP) does not exist or is not executable" - fi - ;; - *) - prog="$(mywhich $IP 2> /dev/null)" - if [ -z "$prog" ] ; then - fatal_error "Can't find $IP executable" - fi - IP=$prog - ;; - esac + if [ -n "$IP" ]; then + case "$IP" in + */*) + if [ ! -x "$IP" ] ; then + fatal_error "The program specified in IP ($IP) does not exist or is not executable" + fi + ;; + *) + prog="$(mywhich $IP 2> /dev/null)" + if [ -z "$prog" ] ; then + fatal_error "Can't find $IP executable" + fi + IP=$prog + ;; + esac + else + IP='ip' + fi else - IP='ip' + [ -n "$SHOREWALL_SHELL" ] || SHOREWALL_SHELL=/bin/sh + [ -n "$IP" ] || IP='ip' fi case $VERBOSITY in