forked from extern/shorewall_code
Compare commits
2 Commits
5.0.4-RC1
...
5.0.3-base
Author | SHA1 | Date | |
---|---|---|---|
|
7a6f975af4 | ||
|
1a762c20da |
@@ -24,9 +24,6 @@
|
|||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx #The Build script inserts the actual version
|
||||||
|
|
||||||
PRODUCT=shorewall-core
|
|
||||||
Product="Shorewall Core"
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
ME=$(basename $0)
|
ME=$(basename $0)
|
||||||
@@ -103,9 +100,6 @@ require()
|
|||||||
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
|
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -346,10 +340,8 @@ fi
|
|||||||
mkdir -p ${DESTDIR}${SBINDIR}
|
mkdir -p ${DESTDIR}${SBINDIR}
|
||||||
chmod 755 ${DESTDIR}${SBINDIR}
|
chmod 755 ${DESTDIR}${SBINDIR}
|
||||||
|
|
||||||
if [ -n "${MANDIR}" ]; then
|
mkdir -p ${DESTDIR}${MANDIR}
|
||||||
mkdir -p ${DESTDIR}${MANDIR}
|
chmod 755 ${DESTDIR}${MANDIR}
|
||||||
chmod 755 ${DESTDIR}${MANDIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${INITFILE}" ]; then
|
if [ -n "${INITFILE}" ]; then
|
||||||
mkdir -p ${DESTDIR}${INITDIR}
|
mkdir -p ${DESTDIR}${INITDIR}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
# loaded after this one and replaces some of the functions declared here.
|
# loaded after this one and replaces some of the functions declared here.
|
||||||
#
|
#
|
||||||
|
|
||||||
SHOREWALL_CAPVERSION=50004
|
SHOREWALL_CAPVERSION=40609
|
||||||
|
|
||||||
[ -n "${g_program:=shorewall}" ]
|
[ -n "${g_program:=shorewall}" ]
|
||||||
|
|
||||||
@@ -2593,7 +2593,6 @@ determine_capabilities() {
|
|||||||
TARPIT_TARGET=
|
TARPIT_TARGET=
|
||||||
IFACE_MATCH=
|
IFACE_MATCH=
|
||||||
TCPMSS_TARGET=
|
TCPMSS_TARGET=
|
||||||
WAIT_OPTION=
|
|
||||||
|
|
||||||
AMANDA_HELPER=
|
AMANDA_HELPER=
|
||||||
FTP_HELPER=
|
FTP_HELPER=
|
||||||
@@ -2617,11 +2616,6 @@ determine_capabilities() {
|
|||||||
qt $arptables -L OUT && ARPTABLESJF=Yes
|
qt $arptables -L OUT && ARPTABLESJF=Yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if qt $g_tool --wait -t filter -L INPUT -n -v; then
|
|
||||||
WAIT_OPTION=Yes
|
|
||||||
tool="$tool --wait"
|
|
||||||
fi
|
|
||||||
|
|
||||||
chain=fooX$$
|
chain=fooX$$
|
||||||
|
|
||||||
if [ -n "$NAT_ENABLED" ]; then
|
if [ -n "$NAT_ENABLED" ]; then
|
||||||
@@ -3080,10 +3074,8 @@ report_capabilities_unsorted() {
|
|||||||
|
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
report_capability "iptables -S (IPTABLES_S)" $IPTABLES_S
|
report_capability "iptables -S (IPTABLES_S)" $IPTABLES_S
|
||||||
report_capability "iptables --wait option (WAIT_OPTION)" $WAIT_OPTION
|
|
||||||
else
|
else
|
||||||
report_capability "ip6tables -S (IPTABLES_S)" $IPTABLES_S
|
report_capability "ip6tables -S (IPTABLES_S)" $IPTABLES_S
|
||||||
report_capability "ip6tables --wait option (WAIT_OPTION)" $WAIT_OPTION
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
report_capability "Basic Filter (BASIC_FILTER)" $BASIC_FILTER
|
report_capability "Basic Filter (BASIC_FILTER)" $BASIC_FILTER
|
||||||
@@ -3193,7 +3185,6 @@ report_capabilities_unsorted1() {
|
|||||||
report_capability1 TARPIT_TARGET
|
report_capability1 TARPIT_TARGET
|
||||||
report_capability1 IFACE_MATCH
|
report_capability1 IFACE_MATCH
|
||||||
report_capability1 TCPMSS_TARGET
|
report_capability1 TCPMSS_TARGET
|
||||||
report_capability1 WAIT_OPTION
|
|
||||||
|
|
||||||
report_capability1 AMANDA_HELPER
|
report_capability1 AMANDA_HELPER
|
||||||
report_capability1 FTP_HELPER
|
report_capability1 FTP_HELPER
|
||||||
@@ -3272,11 +3263,9 @@ show_interfaces() {
|
|||||||
local printed
|
local printed
|
||||||
|
|
||||||
for f in ${VARDIR}/*.status; do
|
for f in ${VARDIR}/*.status; do
|
||||||
if [ -f $f ]; then
|
|
||||||
interface=$(basename $f)
|
interface=$(basename $f)
|
||||||
echo " Interface ${interface%.status} is $(interface_status $f)"
|
echo " Interface ${interface%.status} is $(interface_status $f)"
|
||||||
printed=Yes
|
printed=Yes
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$printed" ] && echo
|
[ -n "$printed" ] && echo
|
||||||
|
@@ -3,21 +3,24 @@
|
|||||||
#
|
#
|
||||||
# Input: host=openwrt
|
# Input: host=openwrt
|
||||||
#
|
#
|
||||||
PREFIX=/usr #Top-level directory for shared files, libraries, etc.
|
HOST=openwrt
|
||||||
SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
|
PREFIX=/usr
|
||||||
LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
|
SHAREDIR=${PREFIX}/share
|
||||||
PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl module directory
|
LIBEXECDIR=${PREFIX}/share
|
||||||
CONFDIR=/etc #Directory where subsystem configurations are installed
|
PERLLIBDIR=${PREFIX}/share/shorewall
|
||||||
SBINDIR=/sbin #Directory where system administration programs are installed
|
CONFDIR=/etc
|
||||||
MANDIR= #Directory where manpages are installed.
|
SBINDIR=/sbin
|
||||||
INITDIR=/etc/init.d #Directory where SysV init scripts are installed.
|
MANDIR=${PREFIX}/man
|
||||||
INITFILE=$PRODUCT #Name of the product's installed SysV init script
|
INITDIR=/etc/init.d
|
||||||
INITSOURCE=init.openwrt.sh #Name of the distributed file to be installed as the SysV init script
|
INITSOURCE=init.openwrt.sh
|
||||||
ANNOTATED= #If non-zero, annotated configuration files are installed
|
INITFILE=$PRODUCT
|
||||||
SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init parameter files are installed
|
AUXINITSOURCE=
|
||||||
SYSCONFFILE=sysconfig #Name of the distributed file to be installed in $SYSCONFDIR
|
AUXINITFILE=
|
||||||
SERVICEDIR= #Directory where .service files are installed (systems running systemd only)
|
SERVICEDIR=
|
||||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
SERVICEFILE=
|
||||||
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
|
SYSCONFFILE=default.openwrt
|
||||||
VARLIB=/lib #Directory where product variable data is stored.
|
SYSCONFDIR=${CONFDIR}/sysconfig
|
||||||
VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored.
|
SPARSE=
|
||||||
|
ANNOTATED=
|
||||||
|
VARLIB=/lib
|
||||||
|
VARDIR=${VARLIB}/$PRODUCT
|
||||||
|
@@ -27,8 +27,6 @@
|
|||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx #The Build script inserts the actual version
|
||||||
PRODUCT="shorewall-core"
|
|
||||||
Product="Shorewall Core"
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
@@ -68,11 +66,6 @@ remove_file() # $1 = file to restore
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Read the RC file
|
# Read the RC file
|
||||||
#
|
#
|
||||||
|
@@ -1,131 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V5.0
|
|
||||||
#
|
|
||||||
# (c) 2010,2012-2014 - Tom Eastep (teastep@shorewall.net)
|
|
||||||
# (c) 2016 - Matt Darfeuille (matdarf@gmail.com)
|
|
||||||
#
|
|
||||||
# On most distributions, this file should be called /etc/init.d/shorewall-init.
|
|
||||||
#
|
|
||||||
# This program is part of Shorewall.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by the
|
|
||||||
# Free Software Foundation, either version 2 of the license or, at your
|
|
||||||
# option, any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# arg1 of init script is arg2 when rc.common is sourced
|
|
||||||
|
|
||||||
case "$action" in
|
|
||||||
start|stop|boot)
|
|
||||||
if [ "$(id -u)" != "0" ]
|
|
||||||
then
|
|
||||||
echo "You must be root to start, stop or restart \"Shorewall \"."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if shorewall-init is configured or not
|
|
||||||
if [ -f "/etc/sysconfig/shorewall-init" ]
|
|
||||||
then
|
|
||||||
. /etc/sysconfig/shorewall-init
|
|
||||||
if [ -z "$PRODUCTS" ]
|
|
||||||
then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
enable|disable|enabled)
|
|
||||||
# Openwrt related
|
|
||||||
# start and stop runlevel variable
|
|
||||||
START=19
|
|
||||||
STOP=91
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: /etc/init.d/shorewall-init {start|stop}"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
|
||||||
#
|
|
||||||
# The installer may alter this
|
|
||||||
#
|
|
||||||
. /usr/share/shorewall/shorewallrc
|
|
||||||
|
|
||||||
# Locate the current PRODUCT's statedir
|
|
||||||
setstatedir() {
|
|
||||||
local statedir
|
|
||||||
if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then
|
|
||||||
statedir=$( . ${CONFDIR}/${PRODUCT}/vardir && echo $VARDIR )
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
|
||||||
|
|
||||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
|
||||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Initialize the firewall
|
|
||||||
start () {
|
|
||||||
local PRODUCT
|
|
||||||
local STATEDIR
|
|
||||||
|
|
||||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
|
||||||
if setstatedir; then
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
|
||||||
ipset -R < "$SAVE_IPSETS"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
boot () {
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
# Clear the firewall
|
|
||||||
stop () {
|
|
||||||
local PRODUCT
|
|
||||||
local STATEDIR
|
|
||||||
|
|
||||||
echo -n "Clearing \"Shorewall-based firewalls\": "
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
|
||||||
if setstatedir; then
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" ]; then
|
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
@@ -28,8 +28,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version.
|
VERSION=xxx #The Build script inserts the actual version.
|
||||||
PRODUCT=shorewall-init
|
|
||||||
Product="Shorewall Init"
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
@@ -73,50 +71,39 @@ mywhich() {
|
|||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_install()
|
||||||
|
{
|
||||||
|
if ! install $*; then
|
||||||
|
echo
|
||||||
|
echo "ERROR: Failed to install $*" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
cant_autostart()
|
cant_autostart()
|
||||||
{
|
{
|
||||||
echo
|
echo
|
||||||
echo "WARNING: Unable to configure shorewall init to start automatically at boot" >&2
|
echo "WARNING: Unable to configure shorewall init to start automatically at boot" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
install_file() # $1 = source $2 = target $3 = mode
|
|
||||||
{
|
|
||||||
if cp -f $1 $2; then
|
|
||||||
if chmod $3 $2; then
|
|
||||||
if [ -n "$OWNER" ]; then
|
|
||||||
if chown $OWNER:$GROUP $2; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "ERROR: Failed to install $2" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
make_directory() # $1 = directory , $2 = mode
|
|
||||||
{
|
|
||||||
mkdir -p $1
|
|
||||||
chmod 0755 $1
|
|
||||||
[ -n "$OWNERSHIP" ] && chown $OWNERSHIP $1
|
|
||||||
}
|
|
||||||
|
|
||||||
require()
|
require()
|
||||||
{
|
{
|
||||||
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
|
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
install_file() # $1 = source $2 = target $3 = mode
|
||||||
# Change to the directory containing this script
|
{
|
||||||
#
|
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
||||||
|
}
|
||||||
|
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
PRODUCT=shorewall-init
|
||||||
|
|
||||||
#
|
#
|
||||||
# Parse the run line
|
# Parse the run line
|
||||||
#
|
#
|
||||||
|
T='-T'
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
@@ -243,8 +230,6 @@ if [ -z "$BUILD" ]; then
|
|||||||
BUILD=slackware
|
BUILD=slackware
|
||||||
elif [ -f /etc/arch-release ] ; then
|
elif [ -f /etc/arch-release ] ; then
|
||||||
BUILD=archlinux
|
BUILD=archlinux
|
||||||
elif [ -f ${CONFDIR}/openwrt_release ]; then
|
|
||||||
BUILD=openwrt
|
|
||||||
else
|
else
|
||||||
BUILD=linux
|
BUILD=linux
|
||||||
fi
|
fi
|
||||||
@@ -252,24 +237,22 @@ if [ -z "$BUILD" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -n "$OWNER" ] || OWNER=$(id -un)
|
||||||
|
[ -n "$GROUP" ] || GROUP=$(id -gn)
|
||||||
|
|
||||||
case $BUILD in
|
case $BUILD in
|
||||||
apple)
|
apple)
|
||||||
[ -z "$OWNER" ] && OWNER=root
|
T=
|
||||||
[ -z "$GROUP" ] && GROUP=wheel
|
|
||||||
;;
|
;;
|
||||||
cygwin*|CYGWIN*)
|
debian|gentoo|redhat|suse|slackware|archlinux)
|
||||||
OWNER=$(id -un)
|
|
||||||
GROUP=$(id -gn)
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ $(id -u) -eq 0 ]; then
|
[ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment"
|
||||||
[ -z "$OWNER" ] && OWNER=root
|
exit 1
|
||||||
[ -z "$GROUP" ] && GROUP=root
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ -n "$OWNER" ] && OWNERSHIP="$OWNER:$GROUP"
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
||||||
|
|
||||||
[ -n "$HOST" ] || HOST=$BUILD
|
[ -n "$HOST" ] || HOST=$BUILD
|
||||||
|
|
||||||
@@ -294,9 +277,6 @@ case "$HOST" in
|
|||||||
suse)
|
suse)
|
||||||
echo "Installing SuSE-specific configuration..."
|
echo "Installing SuSE-specific configuration..."
|
||||||
;;
|
;;
|
||||||
openwrt)
|
|
||||||
echo "Installing Openwrt-specific configuration..."
|
|
||||||
;;
|
|
||||||
linux)
|
linux)
|
||||||
echo "ERROR: Shorewall-init is not supported on this system" >&2
|
echo "ERROR: Shorewall-init is not supported on this system" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -310,12 +290,12 @@ esac
|
|||||||
[ -z "$TARGET" ] && TARGET=$HOST
|
[ -z "$TARGET" ] && TARGET=$HOST
|
||||||
|
|
||||||
if [ -n "$DESTDIR" ]; then
|
if [ -n "$DESTDIR" ]; then
|
||||||
if [ $(id -u) != 0 ] ; then
|
if [ `id -u` != 0 ] ; then
|
||||||
echo "Not setting file owner/group permissions, not running as root."
|
echo "Not setting file owner/group permissions, not running as root."
|
||||||
OWNERSHIP=""
|
OWNERSHIP=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make_directory ${DESTDIR}${INITDIR} 0755
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Shorewall Init Version $VERSION"
|
echo "Installing Shorewall Init Version $VERSION"
|
||||||
@@ -331,7 +311,7 @@ fi
|
|||||||
|
|
||||||
if [ -n "$DESTDIR" ]; then
|
if [ -n "$DESTDIR" ]; then
|
||||||
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
|
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
|
||||||
chmod 0755 ${DESTDIR}${CONFDIR}/logrotate.d
|
chmod 755 ${DESTDIR}${CONFDIR}/logrotate.d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -359,14 +339,14 @@ fi
|
|||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
mkdir -p ${DESTDIR}${SERVICEDIR}
|
mkdir -p ${DESTDIR}${SERVICEDIR}
|
||||||
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
|
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
|
||||||
install_file $SERVICEFILE ${DESTDIR}${SERVICEDIR}/$PRODUCT.service 0644
|
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
|
||||||
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
|
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
|
||||||
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SERVICEDIR}/$PRODUCT.service"
|
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SERVICEDIR}/$PRODUCT.service"
|
||||||
if [ -n "$DESTDIR" -o $configure -eq 0 ]; then
|
if [ -n "$DESTDIR" -o $configure -eq 0 ]; then
|
||||||
mkdir -p ${DESTDIR}${SBINDIR}
|
mkdir -p ${DESTDIR}${SBINDIR}
|
||||||
chmod 0755 ${DESTDIR}${SBINDIR}
|
chmod 755 ${DESTDIR}${SBINDIR}
|
||||||
fi
|
fi
|
||||||
install_file shorewall-init ${DESTDIR}${SBINDIR}/shorewall-init 0700
|
run_install $OWNERSHIP -m 700 shorewall-init ${DESTDIR}${SBINDIR}/shorewall-init
|
||||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall-init
|
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall-init
|
||||||
echo "CLI installed as ${DESTDIR}${SBINDIR}/shorewall-init"
|
echo "CLI installed as ${DESTDIR}${SBINDIR}/shorewall-init"
|
||||||
fi
|
fi
|
||||||
@@ -375,13 +355,13 @@ fi
|
|||||||
# Create /usr/share/shorewall-init if needed
|
# Create /usr/share/shorewall-init if needed
|
||||||
#
|
#
|
||||||
mkdir -p ${DESTDIR}${SHAREDIR}/shorewall-init
|
mkdir -p ${DESTDIR}${SHAREDIR}/shorewall-init
|
||||||
chmod 0755 ${DESTDIR}${SHAREDIR}/shorewall-init
|
chmod 755 ${DESTDIR}${SHAREDIR}/shorewall-init
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install logrotate file
|
# Install logrotate file
|
||||||
#
|
#
|
||||||
if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
|
if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
|
||||||
install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT 0644
|
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT
|
||||||
echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT"
|
echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -389,7 +369,7 @@ fi
|
|||||||
# Create the version file
|
# Create the version file
|
||||||
#
|
#
|
||||||
echo "$VERSION" > ${DESTDIR}/${SHAREDIR}/shorewall-init/version
|
echo "$VERSION" > ${DESTDIR}/${SHAREDIR}/shorewall-init/version
|
||||||
chmod 0644 ${DESTDIR}${SHAREDIR}/shorewall-init/version
|
chmod 644 ${DESTDIR}${SHAREDIR}/shorewall-init/version
|
||||||
|
|
||||||
#
|
#
|
||||||
# Remove and create the symbolic link to the init script
|
# Remove and create the symbolic link to the init script
|
||||||
@@ -432,9 +412,6 @@ else
|
|||||||
elif [ $HOST = gentoo ]; then
|
elif [ $HOST = gentoo ]; then
|
||||||
# Gentoo does not support if-{up,down}.d
|
# Gentoo does not support if-{up,down}.d
|
||||||
/bin/true
|
/bin/true
|
||||||
elif [ $HOST = openwrt ]; then
|
|
||||||
# Not implemented on openwrt
|
|
||||||
/bin/true
|
|
||||||
else
|
else
|
||||||
mkdir -p ${DESTDIR}/${ETC}/NetworkManager/dispatcher.d
|
mkdir -p ${DESTDIR}/${ETC}/NetworkManager/dispatcher.d
|
||||||
fi
|
fi
|
||||||
@@ -442,8 +419,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
|
if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
|
||||||
install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT 0644
|
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT
|
||||||
echo "${SYSCONFFILE} file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
|
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ $HOST = suse ] && IFUPDOWN=ifupdown.suse.sh || IFUPDOWN=ifupdown.fedora.sh
|
[ $HOST = suse ] && IFUPDOWN=ifupdown.suse.sh || IFUPDOWN=ifupdown.fedora.sh
|
||||||
@@ -453,15 +430,13 @@ fi
|
|||||||
# Install the ifupdown script
|
# Install the ifupdown script
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ $HOST != openwrt ]; then
|
cp $IFUPDOWN ifupdown
|
||||||
cp $IFUPDOWN ifupdown
|
|
||||||
|
|
||||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ifupdown
|
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ifupdown
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init
|
mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init
|
||||||
|
|
||||||
install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544
|
install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
|
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
|
||||||
[ $configure -eq 1 ] || mkdir -p ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d/
|
[ $configure -eq 1 ] || mkdir -p ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d/
|
||||||
@@ -514,7 +489,7 @@ case $HOST in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
if [ $configure -eq 1 -a -n "first_install" ]; then
|
if [ $configure -eq 1 -a -n "$first_install" ]; then
|
||||||
if [ $HOST = debian ]; then
|
if [ $HOST = debian ]; then
|
||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
if systemctl enable ${PRODUCT}.service; then
|
if systemctl enable ${PRODUCT}.service; then
|
||||||
@@ -536,13 +511,6 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then
|
|
||||||
/etc/init.d/$PRODUCT enable
|
|
||||||
if /etc/init.d/$PRODUCT enabled; then
|
|
||||||
echo "$Product will start automatically at boot"
|
|
||||||
else
|
|
||||||
cant_autostart
|
|
||||||
fi
|
|
||||||
elif [ $HOST = gentoo ]; then
|
elif [ $HOST = gentoo ]; then
|
||||||
# On Gentoo, a service must be enabled manually by the user,
|
# On Gentoo, a service must be enabled manually by the user,
|
||||||
# not by the installer
|
# not by the installer
|
||||||
@@ -571,13 +539,6 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then
|
|
||||||
/etc/init.d/shorewall-inir enable
|
|
||||||
if /etc/init.d/shorewall-init enabled; then
|
|
||||||
echo "Shorrewall Init will start automatically at boot"
|
|
||||||
else
|
|
||||||
cant_autostart
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
|
@@ -5,8 +5,7 @@
|
|||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shorewall firewall (bootup security)
|
Description=Shorewall firewall (bootup security)
|
||||||
Before=network-pre.target
|
Before=network.target
|
||||||
Wants=network-pre.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
20
Shorewall-init/shorewall-init.service.214
Normal file
20
Shorewall-init/shorewall-init.service.214
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#
|
||||||
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
|
||||||
|
#
|
||||||
|
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Shorewall firewall (bootup security)
|
||||||
|
Before=network-pre.target
|
||||||
|
Wants=network-pre.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-/etc/sysconfig/shorewall-init
|
||||||
|
StandardOutput=syslog
|
||||||
|
ExecStart=/sbin/shorewall-init start
|
||||||
|
ExecStop=/sbin/shorewall-init stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=basic.target
|
21
Shorewall-init/shorewall-init.service.214.debian
Normal file
21
Shorewall-init/shorewall-init.service.214.debian
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
|
||||||
|
#
|
||||||
|
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
|
||||||
|
# Copyright 2015 Tom Eastep <teastep@shorewall.net>
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Shorewall firewall (bootup security)
|
||||||
|
Before=network-pre.target
|
||||||
|
Wants=network-pre.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-/etc/default/shorewall-init
|
||||||
|
StandardOutput=syslog
|
||||||
|
ExecStart=/sbin/shorewall-init start
|
||||||
|
ExecStop=/sbin/shorewall-init stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=basic.target
|
@@ -27,8 +27,6 @@
|
|||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx #The Build script inserts the actual version
|
||||||
PRODUCT=shorewall-init
|
|
||||||
Product="Shorewall Init"
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
@@ -77,11 +75,6 @@ remove_file() # $1 = file to restore
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@@ -169,11 +162,7 @@ INITSCRIPT=${CONFDIR}/init.d/shorewall-init
|
|||||||
|
|
||||||
if [ -f "$INITSCRIPT" ]; then
|
if [ -f "$INITSCRIPT" ]; then
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if [ $HOST = openwrt ]; then
|
if mywhich updaterc.d ; then
|
||||||
if /etc/init.d/shorewall-init enabled; then
|
|
||||||
/etc/init.d/shorewall-init disable
|
|
||||||
fi
|
|
||||||
elif mywhich updaterc.d ; then
|
|
||||||
updaterc.d shorewall-init remove
|
updaterc.d shorewall-init remove
|
||||||
elif mywhich insserv ; then
|
elif mywhich insserv ; then
|
||||||
insserv -r $INITSCRIPT
|
insserv -r $INITSCRIPT
|
||||||
@@ -194,13 +183,8 @@ if [ -n "$SERVICEDIR" ]; then
|
|||||||
rm -f $SERVICEDIR/shorewall-init.service
|
rm -f $SERVICEDIR/shorewall-init.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $HOST = openwrt ]; then
|
[ "$(readlink -m -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local
|
||||||
[ "$(readlink -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local
|
[ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-local
|
||||||
[ "$(readlink -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-local
|
|
||||||
else
|
|
||||||
[ "$(readlink -m -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local
|
|
||||||
[ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-local
|
|
||||||
fi
|
|
||||||
|
|
||||||
remove_file ${CONFDIR}/default/shorewall-init
|
remove_file ${CONFDIR}/default/shorewall-init
|
||||||
remove_file ${CONFDIR}/sysconfig/shorewall-init
|
remove_file ${CONFDIR}/sysconfig/shorewall-init
|
||||||
@@ -214,6 +198,8 @@ remove_file ${CONFDIR}/network/if-post-down.d/shorewall
|
|||||||
remove_file ${CONFDIR}/sysconfig/network/if-up.d/shorewall
|
remove_file ${CONFDIR}/sysconfig/network/if-up.d/shorewall
|
||||||
remove_file ${CONFDIR}/sysconfig/network/if-down.d/shorewall
|
remove_file ${CONFDIR}/sysconfig/network/if-down.d/shorewall
|
||||||
|
|
||||||
|
[ -n "$SYSTEMD" ] && remove_file ${SYSTEMD}/shorewall.service
|
||||||
|
|
||||||
if [ -d ${CONFDIR}/ppp ]; then
|
if [ -d ${CONFDIR}/ppp ]; then
|
||||||
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
||||||
remove_file ${CONFDIR}/ppp/$directory/shorewall
|
remove_file ${CONFDIR}/ppp/$directory/shorewall
|
||||||
|
25
Shorewall-lite/default.openwrt
Normal file
25
Shorewall-lite/default.openwrt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# sysV init file script configuration(/etc/sysconfdir/shorewall-lite)
|
||||||
|
|
||||||
|
# startup option(default "-vvv")
|
||||||
|
OPTIONS=
|
||||||
|
|
||||||
|
# change default start run level(if none empty; /etc/init.d/shorewall-lite enable)
|
||||||
|
START=50
|
||||||
|
|
||||||
|
# change default stop run level(if none empty; /etc/init.d/shorewall-lite enable)
|
||||||
|
STOP=
|
||||||
|
|
||||||
|
# option to pass when shorewall start is executed
|
||||||
|
STARTOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall restart is executed
|
||||||
|
RESTARTOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall reload is executed
|
||||||
|
RELOADOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall stop is executed
|
||||||
|
STOPOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall status is executed
|
||||||
|
STATUSOPTIONS=
|
@@ -32,24 +32,25 @@
|
|||||||
# shorewall-lite start Starts the firewall
|
# shorewall-lite start Starts the firewall
|
||||||
# shorewall-lite restart Restarts the firewall
|
# shorewall-lite restart Restarts the firewall
|
||||||
# shorewall-lite reload Reload the firewall
|
# shorewall-lite reload Reload the firewall
|
||||||
|
# (same as restart)
|
||||||
# shorewall-lite stop Stops the firewall
|
# shorewall-lite stop Stops the firewall
|
||||||
# shorewall-lite status Displays firewall status
|
# shorewall-lite status Displays firewall status
|
||||||
#
|
#
|
||||||
|
|
||||||
# description: Packet filtering firewall
|
# description: Packet filtering firewall
|
||||||
|
|
||||||
# Openwrt related
|
# openwrt stuph
|
||||||
# Start and stop runlevel variable
|
# start and stop runlevel variable
|
||||||
START=50
|
#START=21
|
||||||
STOP=89
|
#STOP=91
|
||||||
# Displays the status command
|
# variable to display what the status command do when /etc/init.d/shorewall-lite is invoke without argument
|
||||||
EXTRA_COMMANDS="status"
|
EXTRA_COMMANDS="status"
|
||||||
EXTRA_HELP=" status Displays firewall status"
|
EXTRA_HELP="Displays shorewall status"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Get startup options (override default)
|
# Get startup options (override default)
|
||||||
################################################################################
|
################################################################################
|
||||||
OPTIONS=
|
OPTIONS="-vvv"
|
||||||
|
|
||||||
#
|
#
|
||||||
# The installer may alter this
|
# The installer may alter this
|
||||||
@@ -60,35 +61,38 @@ if [ -f ${SYSCONFDIR}/shorewall-lite ]; then
|
|||||||
. ${SYSCONFDIR}/shorewall-lite
|
. ${SYSCONFDIR}/shorewall-lite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
START=${START:-21}
|
||||||
|
STOP=${STOP:-91}
|
||||||
|
|
||||||
SHOREWALL_INIT_SCRIPT=1
|
SHOREWALL_INIT_SCRIPT=1
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# E X E C U T I O N B E G I N S H E R E #
|
# E X E C U T I O N B E G I N S H E R E #
|
||||||
################################################################################
|
################################################################################
|
||||||
# Arg1 of init script is arg2 when rc.common is sourced; set to action variable
|
# arg1 of init script is arg2 when rc.common is sourced; set to action variable
|
||||||
command="$action"
|
command="$action"
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $STARTOPTIONS
|
exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${STARTOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
boot() {
|
boot() {
|
||||||
local command="start"
|
local command="start"
|
||||||
start
|
start
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $RESTARTOPTIONS
|
exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${RESTARTOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $RELOADOPTION
|
exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${RELOADOPTION:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $STOPOPTIONS
|
exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${STOPOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $@
|
exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${STATUSOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
21
Shorewall-lite/shorewall-lite.service.214
Normal file
21
Shorewall-lite/shorewall-lite.service.214
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
|
||||||
|
#
|
||||||
|
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Shorewall IPv4 firewall (lite)
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Conflicts=iptables.service firewalld.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-/etc/sysconfig/shorewall-lite
|
||||||
|
StandardOutput=syslog
|
||||||
|
ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
|
||||||
|
ExecStop=/sbin/shorewall-lite $OPTIONS stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=basic.target
|
@@ -1,27 +0,0 @@
|
|||||||
#
|
|
||||||
# Global start/restart/reload/stop options
|
|
||||||
#
|
|
||||||
OPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start options
|
|
||||||
#
|
|
||||||
STARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Restart options
|
|
||||||
#
|
|
||||||
RESTARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Reload options
|
|
||||||
#
|
|
||||||
RELOADOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Stop options
|
|
||||||
#
|
|
||||||
STOPOPTIONS=""
|
|
||||||
|
|
||||||
# EOF
|
|
||||||
>>>>>>> 39caa74... Improved sysconfig files
|
|
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx #The Build script inserts the actual version
|
||||||
PRODUCT=shorewall-lite
|
PRODUCT=shorewall-lite
|
||||||
Product="Shorewall Lite"
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
@@ -206,16 +205,14 @@ fi
|
|||||||
rm -f ${SBINDIR}/shorewall-lite
|
rm -f ${SBINDIR}/shorewall-lite
|
||||||
|
|
||||||
rm -rf ${CONFDIR}/shorewall-lite
|
rm -rf ${CONFDIR}/shorewall-lite
|
||||||
rm -rf ${VARDIR}
|
rm -rf ${VARDIR}/shorewall-lite
|
||||||
rm -rf ${SHAREDIR}/shorewall-lite
|
rm -rf ${SHAREDIR}/shorewall-lite
|
||||||
rm -rf ${LIBEXECDIR}/shorewall-lite
|
rm -rf ${LIBEXECDIR}/shorewall-lite
|
||||||
rm -f ${CONFDIR}/logrotate.d/shorewall-lite
|
rm -f ${CONFDIR}/logrotate.d/shorewall-lite
|
||||||
rm -f ${SYSCONFDIR}/shorewall-lite
|
rm -f ${SYSCONFDIR}/shorewall-lite
|
||||||
|
|
||||||
if [ -n "${MANDIR}" ]; then
|
rm -f ${MANDIR}/man5/shorewall-lite*
|
||||||
rm -f ${MANDIR}/man5/shorewall-lite*
|
rm -f ${MANDIR}/man8/shorewall-lite*
|
||||||
rm -f ${MANDIR}/man8/shorewall-lite*
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Shorewall Lite Uninstalled"
|
echo "Shorewall Lite Uninstalled"
|
||||||
|
|
||||||
|
@@ -292,7 +292,6 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
|
|||||||
$target ,
|
$target ,
|
||||||
'' ,
|
'' ,
|
||||||
$disposition ,
|
$disposition ,
|
||||||
'' ,
|
|
||||||
'' );
|
'' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -387,7 +386,6 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
|
|||||||
$target ,
|
$target ,
|
||||||
'' ,
|
'' ,
|
||||||
$disposition ,
|
$disposition ,
|
||||||
'' ,
|
|
||||||
'' ;
|
'' ;
|
||||||
|
|
||||||
if ( $rule2 || $jump ) {
|
if ( $rule2 || $jump ) {
|
||||||
@@ -417,7 +415,6 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
|
|||||||
'' ,
|
'' ,
|
||||||
'' ,
|
'' ,
|
||||||
'' ,
|
'' ,
|
||||||
'' ,
|
|
||||||
'' );
|
'' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6215,7 +6215,7 @@ sub log_rule_limit( $$$$$$$$ ) {
|
|||||||
|
|
||||||
$matches .= ' ' if $matches && substr( $matches, -1, 1 ) ne ' ';
|
$matches .= ' ' if $matches && substr( $matches, -1, 1 ) ne ' ';
|
||||||
|
|
||||||
unless ( $matches =~ /-m (?:limit|hashlimit) / ) {
|
unless ( $matches =~ /-m limit / ) {
|
||||||
$limit = $globals{LOGLIMIT} unless $limit && $limit ne '-';
|
$limit = $globals{LOGLIMIT} unless $limit && $limit ne '-';
|
||||||
$matches .= $limit if $limit;
|
$matches .= $limit if $limit;
|
||||||
}
|
}
|
||||||
@@ -6562,8 +6562,6 @@ sub set_chain_variables() {
|
|||||||
emit( 'g_tool=$IP6TABLES' );
|
emit( 'g_tool=$IP6TABLES' );
|
||||||
}
|
}
|
||||||
|
|
||||||
emit 'g_tool="$g_tool --wait"' if have_capability 'WAIT_OPTION';
|
|
||||||
|
|
||||||
if ( $config{IP} ) {
|
if ( $config{IP} ) {
|
||||||
emit( qq(IP="$config{IP}") ,
|
emit( qq(IP="$config{IP}") ,
|
||||||
'[ -x "$IP" ] || startup_error "IP=$IP does not exist or is not executable"'
|
'[ -x "$IP" ] || startup_error "IP=$IP does not exist or is not executable"'
|
||||||
@@ -7430,7 +7428,7 @@ sub handle_exclusion( $$$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
# Returns the destination interface specified in the rule, if any.
|
# Returns the destination interface specified in the rule, if any.
|
||||||
#
|
#
|
||||||
sub expand_rule( $$$$$$$$$$$$;$ )
|
sub expand_rule( $$$$$$$$$$$;$ )
|
||||||
{
|
{
|
||||||
my ($chainref , # Chain
|
my ($chainref , # Chain
|
||||||
$restriction, # Determines what to do with interface names in the SOURCE or DEST
|
$restriction, # Determines what to do with interface names in the SOURCE or DEST
|
||||||
@@ -7443,7 +7441,6 @@ sub expand_rule( $$$$$$$$$$$$;$ )
|
|||||||
$loglevel , # Log level (and tag)
|
$loglevel , # Log level (and tag)
|
||||||
$disposition, # Primtive part of the target (RETURN, ACCEPT, ...)
|
$disposition, # Primtive part of the target (RETURN, ACCEPT, ...)
|
||||||
$exceptionrule,# Caller's matches used in exclusion case
|
$exceptionrule,# Caller's matches used in exclusion case
|
||||||
$usergenerated,# Rule came from the IP[6]TABLES target
|
|
||||||
$logname, # Name of chain to name in log messages
|
$logname, # Name of chain to name in log messages
|
||||||
) = @_;
|
) = @_;
|
||||||
|
|
||||||
@@ -7493,7 +7490,7 @@ sub expand_rule( $$$$$$$$$$$$;$ )
|
|||||||
$loglevel = validate_level( $loglevel );
|
$loglevel = validate_level( $loglevel );
|
||||||
$logtag = '' unless defined $logtag;
|
$logtag = '' unless defined $logtag;
|
||||||
}
|
}
|
||||||
} elsif ( $disposition eq 'LOG' && ! $usergenerated ) {
|
} elsif ( $disposition eq 'LOG' ) {
|
||||||
fatal_error "LOG requires a level";
|
fatal_error "LOG requires a level";
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -7608,9 +7605,9 @@ sub expand_rule( $$$$$$$$$$$$;$ )
|
|||||||
|
|
||||||
my $cond3 = conditional_rule( $chainref, $dnet );
|
my $cond3 = conditional_rule( $chainref, $dnet );
|
||||||
|
|
||||||
if ( $loglevel eq '' || $usergenerated ) {
|
if ( $loglevel eq '' ) {
|
||||||
#
|
#
|
||||||
# No logging or user-specified logging -- add the target rule with matches to the rule chain
|
# No logging -- add the target rule with matches to the rule chain
|
||||||
#
|
#
|
||||||
if ( $targetref ) {
|
if ( $targetref ) {
|
||||||
add_expanded_jump( $chainref, $targetref , 0, $matches );
|
add_expanded_jump( $chainref, $targetref , 0, $matches );
|
||||||
|
@@ -186,9 +186,6 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
|
|||||||
|
|
||||||
%actparms
|
%actparms
|
||||||
|
|
||||||
PARMSMODIFIED
|
|
||||||
USEDCALLER
|
|
||||||
|
|
||||||
F_IPV4
|
F_IPV4
|
||||||
F_IPV6
|
F_IPV6
|
||||||
|
|
||||||
@@ -399,7 +396,6 @@ our %capdesc = ( NAT_ENABLED => 'NAT',
|
|||||||
TARPIT_TARGET => 'TARPIT Target',
|
TARPIT_TARGET => 'TARPIT Target',
|
||||||
IFACE_MATCH => 'Iface Match',
|
IFACE_MATCH => 'Iface Match',
|
||||||
TCPMSS_TARGET => 'TCPMSS Target',
|
TCPMSS_TARGET => 'TCPMSS Target',
|
||||||
WAIT_OPTION => 'iptables --wait option',
|
|
||||||
|
|
||||||
AMANDA_HELPER => 'Amanda Helper',
|
AMANDA_HELPER => 'Amanda Helper',
|
||||||
FTP_HELPER => 'FTP Helper',
|
FTP_HELPER => 'FTP Helper',
|
||||||
@@ -549,7 +545,6 @@ our %compiler_params;
|
|||||||
#
|
#
|
||||||
our %actparms;
|
our %actparms;
|
||||||
our $parmsmodified;
|
our $parmsmodified;
|
||||||
our $usedcaller;
|
|
||||||
our $inline_matches;
|
our $inline_matches;
|
||||||
|
|
||||||
our $currentline; # Current config file line image
|
our $currentline; # Current config file line image
|
||||||
@@ -600,9 +595,6 @@ use constant { MIN_VERBOSITY => -1,
|
|||||||
F_IPV6 => 6,
|
F_IPV6 => 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
use constant { PARMSMODIFIED => 1,
|
|
||||||
USEDCALLER => 2 };
|
|
||||||
|
|
||||||
our %validlevels; # Valid log levels.
|
our %validlevels; # Valid log levels.
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -722,7 +714,7 @@ sub initialize( $;$$) {
|
|||||||
EXPORT => 0,
|
EXPORT => 0,
|
||||||
KLUDGEFREE => '',
|
KLUDGEFREE => '',
|
||||||
VERSION => "5.0.1",
|
VERSION => "5.0.1",
|
||||||
CAPVERSION => 50004 ,
|
CAPVERSION => 40609 ,
|
||||||
BLACKLIST_LOG_TAG => '',
|
BLACKLIST_LOG_TAG => '',
|
||||||
RELATED_LOG_TAG => '',
|
RELATED_LOG_TAG => '',
|
||||||
MACLIST_LOG_TAG => '',
|
MACLIST_LOG_TAG => '',
|
||||||
@@ -997,7 +989,6 @@ sub initialize( $;$$) {
|
|||||||
TARPIT_TARGET => undef,
|
TARPIT_TARGET => undef,
|
||||||
IFACE_MATCH => undef,
|
IFACE_MATCH => undef,
|
||||||
TCPMSS_TARGET => undef,
|
TCPMSS_TARGET => undef,
|
||||||
WAIT_OPTION => undef,
|
|
||||||
|
|
||||||
AMANDA_HELPER => undef,
|
AMANDA_HELPER => undef,
|
||||||
FTP_HELPER => undef,
|
FTP_HELPER => undef,
|
||||||
@@ -1052,7 +1043,6 @@ sub initialize( $;$$) {
|
|||||||
|
|
||||||
%actparms = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '' );
|
%actparms = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '' );
|
||||||
$parmsmodified = 0;
|
$parmsmodified = 0;
|
||||||
$usedcaller = 0;
|
|
||||||
|
|
||||||
%helpers_enabled = (
|
%helpers_enabled = (
|
||||||
amanda => 1,
|
amanda => 1,
|
||||||
@@ -2222,10 +2212,7 @@ sub split_line2( $$;$$$ ) {
|
|||||||
$pairs = '';
|
$pairs = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $currline =~ /^\s*IP6?TABLES\(.*\)/ ) {
|
|
||||||
fatal_error "Shorewall Configuration file entries may not contain double quotes, single back quotes or backslashes" if $columns =~ /["`\\]/;
|
fatal_error "Shorewall Configuration file entries may not contain double quotes, single back quotes or backslashes" if $columns =~ /["`\\]/;
|
||||||
}
|
|
||||||
|
|
||||||
fatal_error "Non-ASCII gunk in file" if $columns =~ /[^\s[:print:]]/;
|
fatal_error "Non-ASCII gunk in file" if $columns =~ /[^\s[:print:]]/;
|
||||||
|
|
||||||
my @line = split_columns( $columns );
|
my @line = split_columns( $columns );
|
||||||
@@ -2510,7 +2497,7 @@ sub evaluate_expression( $$$ ) {
|
|||||||
my ( $first, $var, $rest ) = ( $1, $3, $4);
|
my ( $first, $var, $rest ) = ( $1, $3, $4);
|
||||||
$var = numeric_value( $var ) if $var =~ /^\d/;
|
$var = numeric_value( $var ) if $var =~ /^\d/;
|
||||||
$val = $var ? $actparms{$var} : $chain;
|
$val = $var ? $actparms{$var} : $chain;
|
||||||
$usedcaller = USEDCALLER if $var eq 'caller';
|
$parmsmodified ||= $var eq 'caller';
|
||||||
$expression = join_parts( $first, $val, $rest );
|
$expression = join_parts( $first, $val, $rest );
|
||||||
directive_error( "Variable Expansion Loop" , $filename, $linenumber ) if ++$count > 100;
|
directive_error( "Variable Expansion Loop" , $filename, $linenumber ) if ++$count > 100;
|
||||||
}
|
}
|
||||||
@@ -2647,7 +2634,7 @@ sub process_compiler_directive( $$$$ ) {
|
|||||||
my $val = $actparms{$var} = evaluate_expression ( $expression,
|
my $val = $actparms{$var} = evaluate_expression ( $expression,
|
||||||
$filename,
|
$filename,
|
||||||
$linenumber );
|
$linenumber );
|
||||||
$parmsmodified = PARMSMODIFIED;
|
$parmsmodified = 1;
|
||||||
} else {
|
} else {
|
||||||
$variables{$2} = evaluate_expression( $expression,
|
$variables{$2} = evaluate_expression( $expression,
|
||||||
$filename,
|
$filename,
|
||||||
@@ -3183,12 +3170,10 @@ sub push_action_params( $$$$$$ ) {
|
|||||||
my @parms = ( undef , split_list3( $parms , 'parameter' ) );
|
my @parms = ( undef , split_list3( $parms , 'parameter' ) );
|
||||||
|
|
||||||
$actparms{modified} = $parmsmodified;
|
$actparms{modified} = $parmsmodified;
|
||||||
$actparms{usedcaller} = $usedcaller;
|
|
||||||
|
|
||||||
my %oldparms = %actparms;
|
my %oldparms = %actparms;
|
||||||
|
|
||||||
$parmsmodified = 0;
|
$parmsmodified = 0;
|
||||||
$usedcaller = 0;
|
|
||||||
|
|
||||||
%actparms = ();
|
%actparms = ();
|
||||||
|
|
||||||
@@ -3214,16 +3199,13 @@ sub push_action_params( $$$$$$ ) {
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Pop the action parameters using the passed hash reference
|
# Pop the action parameters using the passed hash reference
|
||||||
# Return:
|
# Return true of the popped parameters were modified
|
||||||
# 1 if the popped parameters were modified
|
|
||||||
# 2 if the action used @CALLER
|
|
||||||
#
|
#
|
||||||
sub pop_action_params( $ ) {
|
sub pop_action_params( $ ) {
|
||||||
my $oldparms = shift;
|
my $oldparms = shift;
|
||||||
%actparms = %$oldparms;
|
%actparms = %$oldparms;
|
||||||
my $return = $parmsmodified ? $parmsmodified : ( $usedcaller || 0 );
|
my $return = $parmsmodified;
|
||||||
( $parmsmodified ) = delete $actparms{modified};
|
( $parmsmodified ) = delete $actparms{modified};
|
||||||
( $usedcaller ) = delete $actparms{usedcaller};
|
|
||||||
$return;
|
$return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3318,7 +3300,6 @@ sub expand_variables( \$ ) {
|
|||||||
$val = $variables{$var};
|
$val = $variables{$var};
|
||||||
} elsif ( exists $actparms{$var} ) {
|
} elsif ( exists $actparms{$var} ) {
|
||||||
$val = $actparms{$var};
|
$val = $actparms{$var};
|
||||||
$usedcaller = USEDCALLER if $var eq 'caller';
|
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Undefined shell variable (\$$var)" unless $config{IGNOREUNKNOWNVARIABLES} || exists $config{$var};
|
fatal_error "Undefined shell variable (\$$var)" unless $config{IGNOREUNKNOWNVARIABLES} || exists $config{$var};
|
||||||
}
|
}
|
||||||
@@ -3337,7 +3318,6 @@ sub expand_variables( \$ ) {
|
|||||||
while ( $$lineref =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) {
|
while ( $$lineref =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) {
|
||||||
my ( $first, $var, $rest ) = ( $1, $3, $4);
|
my ( $first, $var, $rest ) = ( $1, $3, $4);
|
||||||
my $val = $var ? $actparms{$var} : $actparms{chain};
|
my $val = $var ? $actparms{$var} : $actparms{chain};
|
||||||
$usedcaller = USEDCALLER if $var eq 'caller';
|
|
||||||
$val = '' unless defined $val;
|
$val = '' unless defined $val;
|
||||||
$$lineref = join( '', $first , $val , $rest );
|
$$lineref = join( '', $first , $val , $rest );
|
||||||
fatal_error "Variable Expansion Loop" if ++$count > 100;
|
fatal_error "Variable Expansion Loop" if ++$count > 100;
|
||||||
@@ -3983,7 +3963,7 @@ sub Udpliteredirect() {
|
|||||||
|
|
||||||
sub Mangle_Enabled() {
|
sub Mangle_Enabled() {
|
||||||
if ( qt1( "$iptables $iptablesw -t mangle -L -n" ) ) {
|
if ( qt1( "$iptables $iptablesw -t mangle -L -n" ) ) {
|
||||||
system( "$iptables $iptablesw -t mangle -N $sillyname" ) == 0 || fatal_error "Cannot Create Mangle chain $sillyname";
|
system( "$iptables -t mangle -N $sillyname" ) == 0 || fatal_error "Cannot Create Mangle chain $sillyname";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4626,7 +4606,6 @@ sub determine_capabilities() {
|
|||||||
my $pid = $$;
|
my $pid = $$;
|
||||||
|
|
||||||
$capabilities{CAPVERSION} = $globals{CAPVERSION};
|
$capabilities{CAPVERSION} = $globals{CAPVERSION};
|
||||||
$capabilities{WAIT_OPTION} = $iptablesw;
|
|
||||||
|
|
||||||
determine_kernelversion;
|
determine_kernelversion;
|
||||||
|
|
||||||
@@ -5104,8 +5083,6 @@ sub read_capabilities() {
|
|||||||
|
|
||||||
$globals{KLUDGEFREE} = $capabilities{KLUDGEFREE};
|
$globals{KLUDGEFREE} = $capabilities{KLUDGEFREE};
|
||||||
|
|
||||||
$iptablesw = '-w' if $capabilities{WAIT_OPTION};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -614,8 +614,7 @@ sub process_stoppedrules() {
|
|||||||
$target,
|
$target,
|
||||||
'',
|
'',
|
||||||
$disposition,
|
$disposition,
|
||||||
do_proto( $proto, '-', '-' ),
|
do_proto( $proto, '-', '-' ) );
|
||||||
'');
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warning_message "Redundant OUTPUT rule ignored because ADMINISABSENTMINDED=Yes";
|
warning_message "Redundant OUTPUT rule ignored because ADMINISABSENTMINDED=Yes";
|
||||||
|
@@ -345,8 +345,7 @@ sub process_one_masq1( $$$$$$$$$$$ )
|
|||||||
$target ,
|
$target ,
|
||||||
'' ,
|
'' ,
|
||||||
'' ,
|
'' ,
|
||||||
$exceptionrule ,
|
$exceptionrule )
|
||||||
'' )
|
|
||||||
unless unreachable_warning( 0, $chainref );
|
unless unreachable_warning( 0, $chainref );
|
||||||
|
|
||||||
conditional_rule_end( $chainref ) if $detectaddress || $conditional;
|
conditional_rule_end( $chainref ) if $detectaddress || $conditional;
|
||||||
@@ -796,8 +795,7 @@ sub handle_nat_rule( $$$$$$$$$$$$$ ) {
|
|||||||
$target ,
|
$target ,
|
||||||
$loglevel ,
|
$loglevel ,
|
||||||
$log_action ,
|
$log_action ,
|
||||||
$serverport ? do_proto( $proto, '', '' ) : '' ,
|
$serverport ? do_proto( $proto, '', '' ) : '',
|
||||||
'' ,
|
|
||||||
)
|
)
|
||||||
unless unreachable_warning( $wildcard, $chainref );
|
unless unreachable_warning( $wildcard, $chainref );
|
||||||
|
|
||||||
@@ -869,7 +867,6 @@ sub handle_nonat_rule( $$$$$$$$$$$ ) {
|
|||||||
$loglevel,
|
$loglevel,
|
||||||
$log_action,
|
$log_action,
|
||||||
'',
|
'',
|
||||||
'',
|
|
||||||
dnat_chain( $sourcezone ) )
|
dnat_chain( $sourcezone ) )
|
||||||
unless unreachable_warning( $wildcard, $chn );
|
unless unreachable_warning( $wildcard, $chn );
|
||||||
|
|
||||||
@@ -891,7 +888,6 @@ sub handle_nonat_rule( $$$$$$$$$$$ ) {
|
|||||||
$loglevel ,
|
$loglevel ,
|
||||||
$log_action ,
|
$log_action ,
|
||||||
'',
|
'',
|
||||||
'',
|
|
||||||
)
|
)
|
||||||
unless unreachable_warning( $wildcard, $nonat_chain );
|
unless unreachable_warning( $wildcard, $nonat_chain );
|
||||||
}
|
}
|
||||||
|
@@ -98,8 +98,6 @@ sub process_conntrack_rule( $$$$$$$$$$ ) {
|
|||||||
$action = join( ":" , 'LOG', $action );
|
$action = join( ":" , 'LOG', $action );
|
||||||
}
|
}
|
||||||
|
|
||||||
my $usergenerated;
|
|
||||||
|
|
||||||
if ( $action eq 'NOTRACK' ) {
|
if ( $action eq 'NOTRACK' ) {
|
||||||
#
|
#
|
||||||
# A patch that deimplements the NOTRACK target has been posted on the
|
# A patch that deimplements the NOTRACK target has been posted on the
|
||||||
@@ -206,8 +204,7 @@ sub process_conntrack_rule( $$$$$$$$$$ ) {
|
|||||||
$action ,
|
$action ,
|
||||||
$level || '' ,
|
$level || '' ,
|
||||||
$disposition ,
|
$disposition ,
|
||||||
$exception_rule ,
|
$exception_rule );
|
||||||
$usergenerated && ! $level );
|
|
||||||
|
|
||||||
progress_message " Conntrack rule \"$currentline\" $done";
|
progress_message " Conntrack rule \"$currentline\" $done";
|
||||||
}
|
}
|
||||||
@@ -250,7 +247,6 @@ sub handle_helper_rule( $$$$$$$$$$$ ) {
|
|||||||
$action_target ,
|
$action_target ,
|
||||||
'',
|
'',
|
||||||
'CT' ,
|
'CT' ,
|
||||||
'' ,
|
|
||||||
'' );
|
'' );
|
||||||
} else {
|
} else {
|
||||||
expand_rule( ensure_raw_chain( notrack_chain( $sourceref->{name} ) ) ,
|
expand_rule( ensure_raw_chain( notrack_chain( $sourceref->{name} ) ) ,
|
||||||
@@ -265,7 +261,6 @@ sub handle_helper_rule( $$$$$$$$$$$ ) {
|
|||||||
$action_target ,
|
$action_target ,
|
||||||
'' ,
|
'' ,
|
||||||
'CT' ,
|
'CT' ,
|
||||||
'' ,
|
|
||||||
'' );
|
'' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -79,10 +79,6 @@ use constant { NULL_SECTION => 0x00,
|
|||||||
NEW_SECTION => 0x40,
|
NEW_SECTION => 0x40,
|
||||||
DEFAULTACTION_SECTION => 0x80 };
|
DEFAULTACTION_SECTION => 0x80 };
|
||||||
#
|
#
|
||||||
# Number of elements in the action tuple
|
|
||||||
#
|
|
||||||
use constant { ACTION_TUPLE_ELEMENTS => 5 };
|
|
||||||
#
|
|
||||||
# Section => name function
|
# Section => name function
|
||||||
#
|
#
|
||||||
our %section_functions = ( ALL_SECTION , \&rules_chain,
|
our %section_functions = ( ALL_SECTION , \&rules_chain,
|
||||||
@@ -428,7 +424,6 @@ sub print_policy($$$$) {
|
|||||||
sub use_policy_action( $$ );
|
sub use_policy_action( $$ );
|
||||||
sub normalize_action( $$$ );
|
sub normalize_action( $$$ );
|
||||||
sub normalize_action_name( $ );
|
sub normalize_action_name( $ );
|
||||||
sub normalize_single_action( $ );
|
|
||||||
|
|
||||||
sub process_default_action( $$$$ ) {
|
sub process_default_action( $$$$ ) {
|
||||||
my ( $originalpolicy, $policy, $default, $level ) = @_;
|
my ( $originalpolicy, $policy, $default, $level ) = @_;
|
||||||
@@ -446,7 +441,7 @@ sub process_default_action( $$$$ ) {
|
|||||||
if ( "\L$default" eq 'none' ) {
|
if ( "\L$default" eq 'none' ) {
|
||||||
if ( supplied $param || ( supplied $level && $level ne 'none' ) ) {
|
if ( supplied $param || ( supplied $level && $level ne 'none' ) ) {
|
||||||
if ( $default_option ) {
|
if ( $default_option ) {
|
||||||
fatal_error "Invalid setting ($originalpolicy) for $policy";
|
fatal_error "Invalid setting (originalpolicy) for $policy";
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Invalid policy ($originalpolicy)";
|
fatal_error "Invalid policy ($originalpolicy)";
|
||||||
}
|
}
|
||||||
@@ -565,7 +560,7 @@ sub process_a_policy() {
|
|||||||
|
|
||||||
require_capability 'AUDIT_TARGET', ":audit", "s" if $audit;
|
require_capability 'AUDIT_TARGET', ":audit", "s" if $audit;
|
||||||
|
|
||||||
my ( $policy, $default, $level, undef, $remainder ) = split( /:/, $originalpolicy, ACTION_TUPLE_ELEMENTS );
|
my ( $policy, $default, $level, $remainder ) = split( /:/, $originalpolicy, 4 );
|
||||||
|
|
||||||
fatal_error "Invalid or missing POLICY ($originalpolicy)" unless $policy;
|
fatal_error "Invalid or missing POLICY ($originalpolicy)" unless $policy;
|
||||||
|
|
||||||
@@ -949,7 +944,7 @@ sub complete_standard_chain ( $$$$ ) {
|
|||||||
( $policy, $loglevel, $defaultaction ) = @{$policychainref}{'policy', 'loglevel', 'default' };
|
( $policy, $loglevel, $defaultaction ) = @{$policychainref}{'policy', 'loglevel', 'default' };
|
||||||
$stdchainref->{origin} = $policychainref->{origin};
|
$stdchainref->{origin} = $policychainref->{origin};
|
||||||
} elsif ( $defaultaction !~ /:/ ) {
|
} elsif ( $defaultaction !~ /:/ ) {
|
||||||
$defaultaction = normalize_single_action( $defaultaction );
|
$defaultaction = join(":", $defaultaction, 'none', '', '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1174,15 +1169,14 @@ sub finish_section ( $ ) {
|
|||||||
#
|
#
|
||||||
# Create a normalized action name from the passed pieces.
|
# Create a normalized action name from the passed pieces.
|
||||||
#
|
#
|
||||||
# Internally, action invocations are uniquely identified by a 5-tuple that
|
# Internally, action invocations are uniquely identified by a 4-tuple that
|
||||||
# includes the action name, log level, log tag, calling chain and params.
|
# includes the action name, log level, log tag and params. The pieces of the tuple
|
||||||
# The pieces of the tuple are separated by ":".
|
# are separated by ":".
|
||||||
#
|
#
|
||||||
sub normalize_action( $$$ ) {
|
sub normalize_action( $$$ ) {
|
||||||
my $action = shift;
|
my $action = shift;
|
||||||
my $level = shift;
|
my $level = shift;
|
||||||
my $param = shift;
|
my $param = shift;
|
||||||
my $caller = ''; #We assume that the function doesn't use @CALLER
|
|
||||||
|
|
||||||
( $level, my $tag ) = split ':', $level;
|
( $level, my $tag ) = split ':', $level;
|
||||||
|
|
||||||
@@ -1191,23 +1185,13 @@ sub normalize_action( $$$ ) {
|
|||||||
$param = '' unless defined $param;
|
$param = '' unless defined $param;
|
||||||
$param = '' if $param eq '-';
|
$param = '' if $param eq '-';
|
||||||
|
|
||||||
join( ':', $action, $level, $tag, $caller, $param );
|
join( ':', $action, $level, $tag, $param );
|
||||||
}
|
|
||||||
|
|
||||||
#
|
|
||||||
# Add the actual caller into an existing normalised name
|
|
||||||
#
|
|
||||||
sub insert_caller($$) {
|
|
||||||
my ( $normalized, $caller ) = @_;
|
|
||||||
|
|
||||||
my ( $action, $level, $tag, undef, $param ) = split /:/, $normalized;
|
|
||||||
|
|
||||||
join( ':', $action, $level, $tag, $caller, $param );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Accepts a rule target and returns a normalized tuple
|
# Accepts a rule target and returns a normalized tuple
|
||||||
#
|
#
|
||||||
|
|
||||||
sub normalize_action_name( $ ) {
|
sub normalize_action_name( $ ) {
|
||||||
my $target = shift;
|
my $target = shift;
|
||||||
my ( $action, $loglevel) = split_action $target;
|
my ( $action, $loglevel) = split_action $target;
|
||||||
@@ -1215,18 +1199,11 @@ sub normalize_action_name( $ ) {
|
|||||||
normalize_action( $action, $loglevel, '' );
|
normalize_action( $action, $loglevel, '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Create an action tuple from a single target name
|
|
||||||
#
|
|
||||||
sub normalize_single_action( $ ) {
|
|
||||||
join(":", $_[0], 'none', '', '', '' );
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Produce a recognizable target from a normalized action
|
# Produce a recognizable target from a normalized action
|
||||||
#
|
#
|
||||||
sub external_name( $ ) {
|
sub external_name( $ ) {
|
||||||
my ( $target, $level, $tag, undef, $params ) = split /:/, shift, ACTION_TUPLE_ELEMENTS;
|
my ( $target, $level, $tag, $params ) = split /:/, shift, 4;
|
||||||
|
|
||||||
$target = join( '', $target, '(', $params , ')' ) if $params;
|
$target = join( '', $target, '(', $params , ')' ) if $params;
|
||||||
$target .= ":$level" if $level && $level ne 'none';
|
$target .= ":$level" if $level && $level ne 'none';
|
||||||
@@ -1356,7 +1333,7 @@ sub createsimpleactionchain( $ ) {
|
|||||||
sub createactionchain( $ ) {
|
sub createactionchain( $ ) {
|
||||||
my $normalized = shift;
|
my $normalized = shift;
|
||||||
|
|
||||||
my ( $target, $level, $tag, $caller, $param ) = split /:/, $normalized, ACTION_TUPLE_ELEMENTS;
|
my ( $target, $level, $tag, $param ) = split /:/, $normalized, 4;
|
||||||
|
|
||||||
assert( defined $param );
|
assert( defined $param );
|
||||||
|
|
||||||
@@ -1716,7 +1693,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ );
|
|||||||
sub process_action($$) {
|
sub process_action($$) {
|
||||||
my ( $chainref, $caller ) = @_;
|
my ( $chainref, $caller ) = @_;
|
||||||
my $wholeaction = $chainref->{action};
|
my $wholeaction = $chainref->{action};
|
||||||
my ( $action, $level, $tag, undef, $param ) = split /:/, $wholeaction, ACTION_TUPLE_ELEMENTS;
|
my ( $action, $level, $tag, $param ) = split /:/, $wholeaction, 4;
|
||||||
|
|
||||||
if ( $targets{$action} & BUILTIN ) {
|
if ( $targets{$action} & BUILTIN ) {
|
||||||
$level = '' if $level =~ /none!?/;
|
$level = '' if $level =~ /none!?/;
|
||||||
@@ -1932,7 +1909,7 @@ sub process_actions() {
|
|||||||
sub use_policy_action( $$ ) {
|
sub use_policy_action( $$ ) {
|
||||||
my $ref = use_action( $_[0] );
|
my $ref = use_action( $_[0] );
|
||||||
if ( $ref ) {
|
if ( $ref ) {
|
||||||
delete $usedactions{$ref->{action}} if process_action( $ref, $_[1] ) & PARMSMODIFIED;
|
delete $usedactions{$ref->{action}} if process_action( $ref, $_[1] );
|
||||||
} else {
|
} else {
|
||||||
$ref = $usedactions{$_[0]};
|
$ref = $usedactions{$_[0]};
|
||||||
}
|
}
|
||||||
@@ -2287,7 +2264,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $matches = $rule;
|
my $matches = $rule;
|
||||||
my $raw_matches = '';
|
my $raw_matches = '';
|
||||||
my $exceptionrule = '';
|
my $exceptionrule = '';
|
||||||
my $usergenerated;
|
|
||||||
|
|
||||||
if ( $inchain = defined $chainref ) {
|
if ( $inchain = defined $chainref ) {
|
||||||
( $inaction, undef, undef, undef ) = split /:/, $normalized_action = $chainref->{action}, 4 if $chainref->{action};
|
( $inaction, undef, undef, undef ) = split /:/, $normalized_action = $chainref->{action}, 4 if $chainref->{action};
|
||||||
@@ -2311,8 +2287,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
fatal_error "Unknown ACTION ($action)" unless $actiontype;
|
fatal_error "Unknown ACTION ($action)" unless $actiontype;
|
||||||
|
|
||||||
$usergenerated = $actiontype & IPTABLES;
|
|
||||||
|
|
||||||
if ( $actiontype == MACRO ) {
|
if ( $actiontype == MACRO ) {
|
||||||
#
|
#
|
||||||
# process_macro() will call process_rule() recursively for each rule in the macro body
|
# process_macro() will call process_rule() recursively for each rule in the macro body
|
||||||
@@ -2359,8 +2333,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
$param = $param eq '' ? 'drop' : $param;
|
$param = $param eq '' ? 'drop' : $param;
|
||||||
fatal_error "Invalid AUDIT type ($param) -- must be 'accept', 'drop' or 'reject'" unless $param =~ /^(?:accept|drop|reject)$/;
|
fatal_error "Invalid AUDIT type ($param) -- must be 'accept', 'drop' or 'reject'" unless $param =~ /^(?:accept|drop|reject)$/;
|
||||||
$actiontype = STANDARD;
|
$actiontype = STANDARD;
|
||||||
} elsif ( ! $usergenerated ) {
|
} elsif ( $actiontype & NFLOG ) {
|
||||||
if ( $actiontype & NFLOG ) {
|
|
||||||
validate_level( $action );
|
validate_level( $action );
|
||||||
$loglevel = supplied $loglevel ? join( ':', $action, $loglevel ) : $action;
|
$loglevel = supplied $loglevel ? join( ':', $action, $loglevel ) : $action;
|
||||||
$action = 'LOG';
|
$action = 'LOG';
|
||||||
@@ -2368,7 +2341,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
fatal_error "'builtin' actions may only be used in INLINE rules" if $actiontype == USERBUILTIN;
|
fatal_error "'builtin' actions may only be used in INLINE rules" if $actiontype == USERBUILTIN;
|
||||||
fatal_error "The $basictarget TARGET does not accept a parameter" unless $param eq '';
|
fatal_error "The $basictarget TARGET does not accept a parameter" unless $param eq '';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#
|
#
|
||||||
# We can now dispense with the postfix character
|
# We can now dispense with the postfix character
|
||||||
#
|
#
|
||||||
@@ -2684,7 +2657,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
# Handle actions
|
# Handle actions
|
||||||
#
|
#
|
||||||
my $delete_action = 0;
|
my $delete_action;
|
||||||
|
|
||||||
if ( $actiontype & ACTION ) {
|
if ( $actiontype & ACTION ) {
|
||||||
#
|
#
|
||||||
@@ -2701,41 +2674,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $savestatematch = $statematch;
|
my $savestatematch = $statematch;
|
||||||
$statematch = '';
|
$statematch = '';
|
||||||
|
|
||||||
if ( ( $delete_action = process_action( $ref, $chain ) ) & USEDCALLER ) {
|
$delete_action = process_action( $ref, $chain );
|
||||||
#
|
|
||||||
# The chain uses @CALLER but doesn't modify the action parameters.
|
|
||||||
# We need to see if this chain has already called this action
|
|
||||||
#
|
|
||||||
my $renormalized_target = insert_caller( $normalized_target, $chain );
|
|
||||||
my $ref1 = $usedactions{$renormalized_target};
|
|
||||||
|
|
||||||
if ( $ref1 ) {
|
|
||||||
#
|
|
||||||
# It has -- use the prior chain
|
|
||||||
#
|
|
||||||
$ref = $ref1;
|
|
||||||
#
|
|
||||||
# We leave the new chain in place but delete it from %usedactions below
|
|
||||||
#
|
|
||||||
} else {
|
|
||||||
#
|
|
||||||
# This is the first time that the current chain has invoked this action
|
|
||||||
#
|
|
||||||
$usedactions{$renormalized_target} = $ref;
|
|
||||||
#
|
|
||||||
# Swap the action member
|
|
||||||
#
|
|
||||||
$ref->{action} = $renormalized_target;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# Delete the usedactions entry with the original normalized key
|
|
||||||
#
|
|
||||||
delete $usedactions{$normalized_target};
|
|
||||||
#
|
|
||||||
# New normalized target
|
|
||||||
#
|
|
||||||
$normalized_target = $renormalized_target;
|
|
||||||
}
|
|
||||||
#
|
#
|
||||||
# Processing the action may determine that the action or one of it's dependents does NAT or HELPER, so:
|
# Processing the action may determine that the action or one of it's dependents does NAT or HELPER, so:
|
||||||
#
|
#
|
||||||
@@ -2970,12 +2909,11 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
$action ,
|
$action ,
|
||||||
$loglevel ,
|
$loglevel ,
|
||||||
$log_action ,
|
$log_action ,
|
||||||
$exceptionrule ,
|
$exceptionrule )
|
||||||
$usergenerated && ! $loglevel )
|
|
||||||
unless unreachable_warning( $wildcard || $section == DEFAULTACTION_SECTION, $chainref );
|
unless unreachable_warning( $wildcard || $section == DEFAULTACTION_SECTION, $chainref );
|
||||||
}
|
}
|
||||||
|
|
||||||
delete $usedactions{$normalized_target} if $delete_action & PARMSMODIFIED;
|
delete $usedactions{$normalized_target} if $delete_action;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -227,7 +227,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$ ) {
|
|||||||
our $designator;
|
our $designator;
|
||||||
our $ttl = 0;
|
our $ttl = 0;
|
||||||
my $fw = firewall_zone;
|
my $fw = firewall_zone;
|
||||||
my $usergenerated;
|
|
||||||
|
|
||||||
sub handle_mark_param( $$ ) {
|
sub handle_mark_param( $$ ) {
|
||||||
my ( $option, $marktype ) = @_;
|
my ( $option, $marktype ) = @_;
|
||||||
@@ -291,8 +290,7 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$ ) {
|
|||||||
"$target $option " . join( '/', in_hex( $markval ) , $mask ) ,
|
"$target $option " . join( '/', in_hex( $markval ) , $mask ) ,
|
||||||
'',
|
'',
|
||||||
$target ,
|
$target ,
|
||||||
$exceptionrule ,
|
$exceptionrule );
|
||||||
'' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$done = 1;
|
$done = 1;
|
||||||
@@ -454,37 +452,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$ ) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
DIVERTHA => {
|
|
||||||
defaultchain => REALPREROUTING,
|
|
||||||
allowedchains => PREROUTING | REALPREROUTING,
|
|
||||||
minparams => 0,
|
|
||||||
maxparams => 0,
|
|
||||||
function => sub () {
|
|
||||||
fatal_error 'DIVERTHA is only allowed in the PREROUTING chain' if $designator && $designator != PREROUTING;
|
|
||||||
my $mark = in_hex( $globals{TPROXY_MARK} ) . '/' . in_hex( $globals{TPROXY_MARK} );
|
|
||||||
|
|
||||||
unless ( $divertref ) {
|
|
||||||
$divertref = new_chain( 'mangle', 'divert' );
|
|
||||||
add_ijump( $divertref , j => 'MARK', targetopts => "--set-mark $mark" );
|
|
||||||
add_ijump( $divertref , j => 'ACCEPT' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$target = 'divert';
|
|
||||||
|
|
||||||
$matches = '-m socket ';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
DROP => {
|
|
||||||
defaultchain => 0,
|
|
||||||
allowedchains => PREROUTING | FORWARD | OUTPUT | POSTROUTING,
|
|
||||||
minparams => 0,
|
|
||||||
maxparams => 0,
|
|
||||||
function => sub() {
|
|
||||||
$target = 'DROP';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
DSCP => {
|
DSCP => {
|
||||||
defaultchain => 0,
|
defaultchain => 0,
|
||||||
allowedchains => PREROUTING | FORWARD | OUTPUT | POSTROUTING,
|
allowedchains => PREROUTING | FORWARD | OUTPUT | POSTROUTING,
|
||||||
@@ -558,7 +525,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$ ) {
|
|||||||
fatal_error "Unknown target ($tgt)" unless $target_type;
|
fatal_error "Unknown target ($tgt)" unless $target_type;
|
||||||
fatal_error "The $tgt TARGET is not allowed in the mangle table" unless $target_type & MANGLE_TABLE;
|
fatal_error "The $tgt TARGET is not allowed in the mangle table" unless $target_type & MANGLE_TABLE;
|
||||||
$target = $params;
|
$target = $params;
|
||||||
$usergenerated = 1;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -574,7 +540,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$ ) {
|
|||||||
fatal_error "Unknown target ($tgt)" unless $target_type;
|
fatal_error "Unknown target ($tgt)" unless $target_type;
|
||||||
fatal_error "The $tgt TARGET is not allowed in the mangle table" unless $target_type & MANGLE_TABLE;
|
fatal_error "The $tgt TARGET is not allowed in the mangle table" unless $target_type & MANGLE_TABLE;
|
||||||
$target = $params;
|
$target = $params;
|
||||||
$usergenerated = 1;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -885,8 +850,7 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$ ) {
|
|||||||
$target,
|
$target,
|
||||||
'' ,
|
'' ,
|
||||||
$target ,
|
$target ,
|
||||||
$exceptionrule ,
|
$exceptionrule ) )
|
||||||
$usergenerated ) )
|
|
||||||
&& $device ) {
|
&& $device ) {
|
||||||
#
|
#
|
||||||
# expand_rule() returns destination device if any
|
# expand_rule() returns destination device if any
|
||||||
@@ -3154,7 +3118,6 @@ sub process_secmark_rule1( $$$$$$$$$ ) {
|
|||||||
$target ,
|
$target ,
|
||||||
'' ,
|
'' ,
|
||||||
$disposition,
|
$disposition,
|
||||||
'' ,
|
|
||||||
'' );
|
'' );
|
||||||
|
|
||||||
progress_message "Secmarks rule \"$currentline\" $done";
|
progress_message "Secmarks rule \"$currentline\" $done";
|
||||||
|
@@ -322,9 +322,6 @@ if [ $PRODUCT = shorewall ]; then
|
|||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -af Perl/Shorewall/Chains.pm Perl/Shorewall/Chains.pm.bak
|
|
||||||
cp -af Perl/Shorewall/Config.pm Perl/Shorewall/Config.pm.bak
|
|
||||||
|
|
||||||
eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Chains.pm
|
eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Chains.pm
|
||||||
eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Config.pm
|
eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Config.pm
|
||||||
fi
|
fi
|
||||||
@@ -335,9 +332,6 @@ if [ $PRODUCT = shorewall ]; then
|
|||||||
DIGEST=SHA
|
DIGEST=SHA
|
||||||
if ! perl -e 'use Digest::SHA;' 2> /dev/null ; then
|
if ! perl -e 'use Digest::SHA;' 2> /dev/null ; then
|
||||||
if perl -e 'use Digest::SHA1;' 2> /dev/null ; then
|
if perl -e 'use Digest::SHA1;' 2> /dev/null ; then
|
||||||
cp -af Perl/Shorewall/Chains.pm Perl/Shorewall/Chains.pm.bak
|
|
||||||
cp -af Perl/Shorewall/Config.pm Perl/Shorewall/Config.pm.bak
|
|
||||||
|
|
||||||
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Chains.pm
|
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Chains.pm
|
||||||
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Config.pm
|
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Config.pm
|
||||||
DIGEST=SHA1
|
DIGEST=SHA1
|
||||||
@@ -1121,10 +1115,6 @@ if [ -d Perl ]; then
|
|||||||
install_file $f ${DESTDIR}${PERLLIBDIR}/$f 0644
|
install_file $f ${DESTDIR}${PERLLIBDIR}/$f 0644
|
||||||
echo "Module ${f%.*} installed as ${DESTDIR}${PERLLIBDIR}/$f"
|
echo "Module ${f%.*} installed as ${DESTDIR}${PERLLIBDIR}/$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -f Perl/Shorewall/Chains.pm.bak ] && mv Perl/Shorewall/Chains.pm.bak Perl/Shorewall/Chains.pm
|
|
||||||
[ -f Perl/Shorewall/Config.pm.bak ] && mv Perl/Shorewall/Config.pm.bak Perl/Shorewall/Config.pm
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install the program skeleton files
|
# Install the program skeleton files
|
||||||
#
|
#
|
||||||
|
@@ -271,26 +271,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">DIVERTHA</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.0.4. To setup the HAProxy
|
|
||||||
configuration described at <ulink
|
|
||||||
url="http://www.loadbalancer.org/blog/setting-up-haproxy-with-transparent-mode-on-centos-6-x">http://www.loadbalancer.org/blog/setting-up-haproxy-with-transparent-mode-on-centos-6-x</ulink>,
|
|
||||||
place this entry in <ulink
|
|
||||||
url="manpages/shorewall-providers.html">shorewall-providers(5)</ulink>:</para>
|
|
||||||
|
|
||||||
<programlisting>#NAME NUMBER MARK DUPLICATE INTERFACE GATEWAY OPTIONS COPY
|
|
||||||
TProxy 1 - - lo - tproxy</programlisting>
|
|
||||||
|
|
||||||
<para>and use this DIVERTHA entry:</para>
|
|
||||||
|
|
||||||
<programlisting>#ACTION SOURCE DEST PROTO DPORT SPORT USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY DSCP
|
|
||||||
DIVERTHA - - tcp</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">DROP</emphasis></term>
|
<term><emphasis role="bold">DROP</emphasis></term>
|
||||||
|
|
||||||
|
22
Shorewall/shorewall.service.214
Normal file
22
Shorewall/shorewall.service.214
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
|
||||||
|
#
|
||||||
|
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Shorewall IPv4 firewall
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Conflicts=iptables.service firewalld.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-/etc/sysconfig/shorewall
|
||||||
|
StandardOutput=syslog
|
||||||
|
ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
|
||||||
|
ExecStop=/sbin/shorewall $OPTIONS stop
|
||||||
|
ExecReload=/sbin/shorewall $OPTIONS reload $RELOADOPTIONS
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=basic.target
|
@@ -1,27 +0,0 @@
|
|||||||
#
|
|
||||||
# Global start/restart/reload/stop options
|
|
||||||
#
|
|
||||||
OPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start options
|
|
||||||
#
|
|
||||||
STARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Restart options
|
|
||||||
#
|
|
||||||
RESTARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Reload options
|
|
||||||
#
|
|
||||||
RELOADOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Stop options
|
|
||||||
#
|
|
||||||
STOPOPTIONS=""
|
|
||||||
|
|
||||||
# EOF
|
|
||||||
>>>>>>> 39caa74... Improved sysconfig files
|
|
@@ -80,11 +80,6 @@ remove_file() # $1 = file to restore
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
|
25
Shorewall6-lite/default.openwrt
Normal file
25
Shorewall6-lite/default.openwrt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# sysV init file script configuration(/etc/sysconfdir/shorewall-lite)
|
||||||
|
|
||||||
|
# startup option(default "-vvv")
|
||||||
|
OPTIONS=
|
||||||
|
|
||||||
|
# change default start run level(if none empty; /etc/init.d/shorewall-lite enable)
|
||||||
|
START=50
|
||||||
|
|
||||||
|
# change default stop run level(if none empty; /etc/init.d/shorewall-lite enable)
|
||||||
|
STOP=
|
||||||
|
|
||||||
|
# option to pass when shorewall start is executed
|
||||||
|
STARTOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall restart is executed
|
||||||
|
RESTARTOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall reload is executed
|
||||||
|
RELOADOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall stop is executed
|
||||||
|
STOPOPTIONS=
|
||||||
|
|
||||||
|
# option to pass when shorewall status is executed
|
||||||
|
STATUSOPTIONS=
|
@@ -39,18 +39,18 @@
|
|||||||
|
|
||||||
# description: Packet filtering firewall
|
# description: Packet filtering firewall
|
||||||
|
|
||||||
# Openwrt related
|
# openwrt stuph
|
||||||
# Start and stop runlevel variable
|
# start and stop runlevel variable
|
||||||
START=50
|
#START=21
|
||||||
STOP=89
|
#STOP=91
|
||||||
# Displays the status command
|
# variable to display what the status command do when /etc/init.d/shorewall6-lite is invoke without argument
|
||||||
EXTRA_COMMANDS="status"
|
EXTRA_COMMANDS="status"
|
||||||
EXTRA_HELP=" status Displays firewall status"
|
EXTRA_HELP="Displays shorewall status"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Get startup options (override default)
|
# Get startup options (override default)
|
||||||
################################################################################
|
################################################################################
|
||||||
OPTIONS=
|
OPTIONS="-vvv"
|
||||||
|
|
||||||
#
|
#
|
||||||
# The installer may alter this
|
# The installer may alter this
|
||||||
@@ -61,35 +61,38 @@ if [ -f ${SYSCONFDIR}/shorewall6-lite ]; then
|
|||||||
. ${SYSCONFDIR}/shorewall6-lite
|
. ${SYSCONFDIR}/shorewall6-lite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
START=${START:-21}
|
||||||
|
STOP=${STOP:-91}
|
||||||
|
|
||||||
SHOREWALL_INIT_SCRIPT=1
|
SHOREWALL_INIT_SCRIPT=1
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# E X E C U T I O N B E G I N S H E R E #
|
# E X E C U T I O N B E G I N S H E R E #
|
||||||
################################################################################
|
################################################################################
|
||||||
# Arg1 of init script is arg2 when rc.common is sourced; set to action variable
|
# arg1 of init script is arg2 when rc.common is sourced; set to action variable
|
||||||
command="$action"
|
command="$action"
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $STARTOPTIONS
|
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${STARTOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
boot() {
|
boot() {
|
||||||
local command="start"
|
local command="start"
|
||||||
start
|
start
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $RESTARTOPTIONS
|
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${RESTARTOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $RELOADOPTION
|
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${RELOADOPTION:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $STOPOPTIONS
|
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${STOPOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@
|
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${STATUSOPTIONS:-$@}
|
||||||
}
|
}
|
||||||
|
21
Shorewall6-lite/shorewall6-lite.service.214
Normal file
21
Shorewall6-lite/shorewall6-lite.service.214
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
|
||||||
|
#
|
||||||
|
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Shorewall IPv6 firewall (lite)
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Conflicts=ip6tables.service firewalld.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-/etc/sysconfig/shorewall6-lite
|
||||||
|
StandardOutput=syslog
|
||||||
|
ExecStart=/sbin/shorewall6-lite $OPTIONS start
|
||||||
|
ExecStop=/sbin/shorewall6-lite $OPTIONS stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=basic.target
|
@@ -1,27 +0,0 @@
|
|||||||
#
|
|
||||||
# Global start/restart/reload/stop options
|
|
||||||
#
|
|
||||||
OPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start options
|
|
||||||
#
|
|
||||||
STARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Restart options
|
|
||||||
#
|
|
||||||
RESTARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Reload options
|
|
||||||
#
|
|
||||||
RELOADOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Stop options
|
|
||||||
#
|
|
||||||
STOPOPTIONS=""
|
|
||||||
|
|
||||||
# EOF
|
|
||||||
>>>>>>> 39caa74... Improved sysconfig files
|
|
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx #The Build script inserts the actual version
|
||||||
PRODUCT=shorewall6-lite
|
PRODUCT=shorewall6-lite
|
||||||
Product="Shorewall6 Lite"
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
@@ -77,11 +76,6 @@ remove_file() # $1 = file to restore
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@@ -208,15 +202,13 @@ fi
|
|||||||
|
|
||||||
rm -f ${SBINDIR}/shorewall6-lite
|
rm -f ${SBINDIR}/shorewall6-lite
|
||||||
rm -rf ${CONFDIR}/shorewall6-lite
|
rm -rf ${CONFDIR}/shorewall6-lite
|
||||||
rm -rf ${VARDIR}
|
rm -rf ${VARDIR}/shorewall6-lite
|
||||||
rm -rf ${SHAREDIR}/shorewall6-lite
|
rm -rf ${SHAREDIR}/shorewall6-lite
|
||||||
rm -rf ${LIBEXECDIR}/shorewall6-lite
|
rm -rf ${LIBEXECDIR}/shorewall6-lite
|
||||||
rm -f ${CONFDIR}/logrotate.d/shorewall6-lite
|
rm -f ${CONFDIR}/logrotate.d/shorewall6-lite
|
||||||
rm -f ${SYSCONFDIR}/shorewall6-lite
|
rm -f ${SYSCONFDIR}/shorewall6-lite
|
||||||
|
|
||||||
if [ -n "${MANDIR}" ]; then
|
rm -f ${MANDIR}/man5/shorewall6-lite*
|
||||||
rm -f ${MANDIR}/man5/shorewall6-lite*
|
rm -f ${MANDIR}/man8/shorewall6-lite*
|
||||||
rm -f ${MANDIR}/man8/shorewall6-lite*
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Shorewall6 Lite Uninstalled"
|
echo "Shorewall6 Lite Uninstalled"
|
||||||
|
@@ -272,26 +272,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">DIVERTHA</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.0.4. To setup the HAProxy
|
|
||||||
configuration described at <ulink
|
|
||||||
url="http://www.loadbalancer.org/blog/setting-up-haproxy-with-transparent-mode-on-centos-6-x">http://www.loadbalancer.org/blog/setting-up-haproxy-with-transparent-mode-on-centos-6-x</ulink>,
|
|
||||||
place this entry in <ulink
|
|
||||||
url="manpages6/shorewall6-providers.html">shorewall6-providers(5)</ulink>:</para>
|
|
||||||
|
|
||||||
<programlisting>#NAME NUMBER MARK DUPLICATE INTERFACE GATEWAY OPTIONS COPY
|
|
||||||
TProxy 1 - - lo - tproxy</programlisting>
|
|
||||||
|
|
||||||
<para>and use this DIVERTHA entry:</para>
|
|
||||||
|
|
||||||
<programlisting>#ACTION SOURCE DEST PROTO DPORT SPORT USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY DSCP
|
|
||||||
DIVERTHA - - tcp</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">DROP</emphasis></term>
|
<term><emphasis role="bold">DROP</emphasis></term>
|
||||||
|
|
||||||
|
22
Shorewall6/shorewall6.service.214
Normal file
22
Shorewall6/shorewall6.service.214
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
|
||||||
|
#
|
||||||
|
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Shorewall IPv6 firewall
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Conflicts=ip6tables.service firewalld.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-/etc/sysconfig/shorewall6
|
||||||
|
StandardOutput=syslog
|
||||||
|
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||||
|
ExecStop=/sbin/shorewall6 $OPTIONS stop
|
||||||
|
ExecReload=/sbin/shorewall6 $OPTIONS reload $RELOADOPTIONS
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=basic.target
|
@@ -1,27 +0,0 @@
|
|||||||
#
|
|
||||||
# Global start/restart/reload/stop options
|
|
||||||
#
|
|
||||||
OPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start options
|
|
||||||
#
|
|
||||||
STARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Restart options
|
|
||||||
#
|
|
||||||
RESTARTOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Reload options
|
|
||||||
#
|
|
||||||
RELOADOPTIONS=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# Stop options
|
|
||||||
#
|
|
||||||
STOPOPTIONS=""
|
|
||||||
|
|
||||||
# EOF
|
|
||||||
>>>>>>> 39caa74... Improved sysconfig files
|
|
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx #The Build script inserts the actual version
|
||||||
PRODUCT=shorewall6
|
PRODUCT=shorewall6
|
||||||
Product=Shorewall6
|
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
@@ -77,11 +76,6 @@ remove_file() # $1 = file to restore
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@@ -206,7 +200,7 @@ fi
|
|||||||
|
|
||||||
rm -f ${SBINDIR}/shorewall6
|
rm -f ${SBINDIR}/shorewall6
|
||||||
rm -rf ${CONFDIR}/shorewall6
|
rm -rf ${CONFDIR}/shorewall6
|
||||||
rm -rf ${VARDIR}
|
rm -rf ${VARDIR}/shorewall6
|
||||||
rm -rf ${LIBEXECDIR}/shorewall6
|
rm -rf ${LIBEXECDIR}/shorewall6
|
||||||
rm -rf ${SHAREDIR}/shorewall6
|
rm -rf ${SHAREDIR}/shorewall6
|
||||||
|
|
||||||
|
@@ -1950,8 +1950,8 @@ ONBOOT=yes</programlisting>
|
|||||||
url="manpages/shorewall-providers.html">shorewall-providers</ulink> (5)
|
url="manpages/shorewall-providers.html">shorewall-providers</ulink> (5)
|
||||||
is available in the form of a PROBABILITY column in <ulink
|
is available in the form of a PROBABILITY column in <ulink
|
||||||
url="manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5) (<ulink
|
url="manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5) (<ulink
|
||||||
url="manpages4/manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>)
|
url="manpages4/manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>) (5).
|
||||||
(5). This feature requires the <firstterm>Statistic Match</firstterm>
|
This feature requires the <firstterm>Statistic Match</firstterm>
|
||||||
capability in your iptables and kernel.</para>
|
capability in your iptables and kernel.</para>
|
||||||
|
|
||||||
<para>This method works when there are multiple links to the same ISP
|
<para>This method works when there are multiple links to the same ISP
|
||||||
@@ -2219,7 +2219,7 @@ EOF
|
|||||||
#
|
#
|
||||||
# Run LSM -- by default, it forks into the background
|
# Run LSM -- by default, it forks into the background
|
||||||
#
|
#
|
||||||
/usr/sbin/lsm -c /etc/lsm/lsm.conf >> /var/log/lsm
|
/usr/sbin/lsm /etc/lsm/lsm.conf >> /var/log/lsm
|
||||||
}</programlisting>
|
}</programlisting>
|
||||||
|
|
||||||
<para>eth0 has a dynamic IP address so I need to use the
|
<para>eth0 has a dynamic IP address so I need to use the
|
||||||
@@ -2272,8 +2272,8 @@ defaults {
|
|||||||
|
|
||||||
include /etc/lsm/shorewall.conf</programlisting>
|
include /etc/lsm/shorewall.conf</programlisting>
|
||||||
|
|
||||||
<para><filename>/etc/lsm/script</filename> (Shorewall 4.4.23 and later
|
<para><filename>/etc/lsm/script</filename> (Shorewall 4.4.23 and
|
||||||
- note that this script must be executable by root)<programlisting>#!/bin/sh
|
later)<programlisting>#!/bin/sh
|
||||||
#
|
#
|
||||||
# (C) 2009 Mika Ilmaranta <ilmis@nullnet.fi>
|
# (C) 2009 Mika Ilmaranta <ilmis@nullnet.fi>
|
||||||
# (C) 2009 Tom Eastep <teastep@shorewall.net>
|
# (C) 2009 Tom Eastep <teastep@shorewall.net>
|
||||||
|
@@ -72,9 +72,9 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If you set 'ping-check' true in your
|
<para>If you set 'ping-check' true in your
|
||||||
<filename>/etc/dhcp/dhcpd.conf</filename> file then you will want to
|
<filename>/etc/shorewall/dhcpd.conf</filename> file then you will want
|
||||||
<ulink url="ping.html">accept 'ping'</ulink> from your firewall to the
|
to <ulink url="ping.html">accept 'ping'</ulink> from your firewall to
|
||||||
zone(s) served by the firewall's DHCP server.</para>
|
the zone(s) served by the firewall's DHCP server.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
|
Reference in New Issue
Block a user