diff --git a/Shorewall/firewall b/Shorewall/firewall index a3b679eb9..2623443eb 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -1482,25 +1482,6 @@ refresh_blacklist() { fi } -# -# Verify the Black List -# -validate_blacklist() { - local f=$(find_file blacklist) - local disposition=$BLACKLIST_DISPOSITION - - progress_message2 "Checking Black List..." - - strip_file blacklist $f - - [ "$disposition" = REJECT ] && disposition=reject - - while read networks protocol ports; do - expandv networks protocol ports - process_blacklist_rec - done < $TMP_DIR/blacklist -} - # # Verify that kernel has netfilter support # @@ -1594,7 +1575,7 @@ refresh_tc() { strip_file tcdevices strip_file tcclasses - if [ -s $TMP_DIR/tcdevices ]; then + if [ -s $TMP_DIR/tcdevices -o -s $TMP_DIR/tcclasses ]; then lib_load tc LIB_TC_LOADED "Entries in the tcdevices file require the Shorewall library lib.tc which is not installed" setup_traffic_shaping fi diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 8e16e1270..bf9e1e547 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -24,6 +24,18 @@ VERSION=3.3.0 +list_search() # $1 = element to search for , $2-$n = list +{ + local e=$1 + + while [ $# -gt 1 ]; do + shift + [ "x$e" = "x$1" ] && return 0 + done + + return 1 +} + usage() # $1 = exit status { ME=$(basename $0) @@ -32,6 +44,10 @@ usage() # $1 = exit status echo " $ME -h" echo " $ME -n" echo " $ME -c" + echo " $ME -l [ ... ]" + echo " $ME -L [ ... ]" + echo " $ME -m" + echo " $ME -s" exit $1 } @@ -133,9 +149,7 @@ install_file_with_backup() # $1 = source $2 = target $3 = mode $4 = (optional) b # DEST is the SysVInit script directory # INIT is the name of the script in the $DEST directory # RUNLEVELS is the chkconfig parmeters for firewall -# ARGS is "yes" if we've already parsed an argument # -ARGS="" if [ -z "$DEST" ] ; then DEST="/etc/init.d" @@ -159,6 +173,9 @@ fi NOBACKUP= NOCONFIGFILES= +XLIBS= +XCLIBS= +NOMACROS= while [ $# -gt 0 ] ; do case "$1" in @@ -175,12 +192,40 @@ while [ $# -gt 0 ] ; do -c) NOCONFIGFILES=Yes ;; + -m) + NOMACROS=Yes + ;; + -l) + while [ $# -gt 1 ]; do + case $2 in + -*) + break + ;; + *) + XLIBS="$XLIBS $2" + shift + ;; + esac + done + ;; + -L) + while [ $# -gt 1 ]; do + case $2 in + -*) + break + ;; + *) + XCLIBS="$XCLIBS $2" + shift + ;; + esac + done + ;; *) usage 1 ;; esac shift - ARGS="yes" done PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin @@ -652,8 +697,10 @@ for f in clib.* ; do *.\*) ;; *) - install_file $f ${PREFIX}/usr/share/shorewall/$f 0555 - echo "Compiler library ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f" + if ! list_search ${f#clib.} $XCLIBS ; then + install_file $f ${PREFIX}/usr/share/shorewall/$f 0555 + echo "Compiler library ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f" + fi ;; esac done @@ -661,22 +708,27 @@ done # Install the Common Library files # for f in lib.* ; do - install_file $f ${PREFIX}/usr/share/shorewall/$f 0555 - echo "Library ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f" + if ! list_search ${f#lib.} $XLIBS ; then + install_file $f ${PREFIX}/usr/share/shorewall/$f 0555 + echo "Library ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f" + fi done -# -# Install the Macro files -# -for f in macro.* ; do - case $f in - *.\*) + +if [ -z "$NOMACROS" ]; then + # + # Install the Macro files + # + for f in macro.* ; do + case $f in + *.\*) ;; - *) - install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 - echo "Macro ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f" - ;; - esac -done + *) + install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 + echo "Macro ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f" + ;; + esac + done +fi # # Install the program skeleton files #