mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-18 10:40:54 +01:00
Move 4.2 changes to trunk; fix a couple of typos
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9095 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
c22f8363e4
commit
5f86165521
@ -380,7 +380,7 @@ usage() # $1 = exit status
|
|||||||
echo " logreject <address> ..."
|
echo " logreject <address> ..."
|
||||||
echo " logwatch [<refresh interval>]"
|
echo " logwatch [<refresh interval>]"
|
||||||
echo " reject <address> ..."
|
echo " reject <address> ..."
|
||||||
echo " reset"
|
echo " reset [ <chain> ... ]"
|
||||||
echo " restart [ -n ] [ -p ]"
|
echo " restart [ -n ] [ -p ]"
|
||||||
echo " restore [ -n ] [ <file name> ]"
|
echo " restore [ -n ] [ <file name> ]"
|
||||||
echo " save [ <file name> ]"
|
echo " save [ <file name> ]"
|
||||||
@ -591,15 +591,19 @@ case "$COMMAND" in
|
|||||||
shift
|
shift
|
||||||
start_command $@
|
start_command $@
|
||||||
;;
|
;;
|
||||||
stop|reset|clear)
|
stop|clear)
|
||||||
[ $# -ne 1 ] && usage 1
|
[ $# -ne 1 ] && usage 1
|
||||||
verify_firewall_script
|
verify_firewall_script
|
||||||
export NOROUTES
|
export NOROUTES
|
||||||
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $COMMAND
|
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $COMMAND
|
||||||
;;
|
;;
|
||||||
|
reset)
|
||||||
|
verify_firewall_script
|
||||||
|
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $@
|
||||||
|
;;
|
||||||
restart)
|
restart)
|
||||||
shift
|
shift
|
||||||
restart_command $@
|
restart_command
|
||||||
;;
|
;;
|
||||||
show|list)
|
show|list)
|
||||||
shift
|
shift
|
||||||
|
@ -424,7 +424,7 @@ sub initialize( $ ) {
|
|||||||
ULOG => 'ULOG',
|
ULOG => 'ULOG',
|
||||||
NFLOG => 'NFLOG');
|
NFLOG => 'NFLOG');
|
||||||
} else {
|
} else {
|
||||||
$globals{SHAREDIR} = '/usr/share/shorewall';
|
$globals{SHAREDIR} = '/usr/share/shorewall6';
|
||||||
$globals{CONFDIR} = '/etc/shorewall6';
|
$globals{CONFDIR} = '/etc/shorewall6';
|
||||||
|
|
||||||
%config =
|
%config =
|
||||||
|
@ -238,12 +238,12 @@ sub ip_range_explicit( $ ) {
|
|||||||
|
|
||||||
my ( $low, $high ) = split /-/, $range;
|
my ( $low, $high ) = split /-/, $range;
|
||||||
|
|
||||||
validate_address $low, 0;
|
validate_4address $low, 0;
|
||||||
|
|
||||||
push @result, $low;
|
push @result, $low;
|
||||||
|
|
||||||
if ( defined $high ) {
|
if ( defined $high ) {
|
||||||
validate_faddress $high, 0;
|
validate_4address $high, 0;
|
||||||
|
|
||||||
my $first = decodeaddr $low;
|
my $first = decodeaddr $low;
|
||||||
my $last = decodeaddr $high;
|
my $last = decodeaddr $high;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
# --refresh=<chainlist> # Make the 'refresh' command refresh a comma-separated list of chains rather than 'blacklst'.
|
# --refresh=<chainlist> # Make the 'refresh' command refresh a comma-separated list of chains rather than 'blacklst'.
|
||||||
# --log=<filename> # Log file
|
# --log=<filename> # Log file
|
||||||
# --log_verbosity=<number> # Log Verbosity range -1 to 2
|
# --log_verbosity=<number> # Log Verbosity range -1 to 2
|
||||||
# --family=<number> # IP family; 1 = IPv4, 2 = IPv6
|
# --family=<number> # IP family; 4 = IPv4, 6 = IPv6
|
||||||
#
|
#
|
||||||
use strict;
|
use strict;
|
||||||
use FindBin;
|
use FindBin;
|
||||||
|
@ -1728,7 +1728,7 @@ add_a_rule() {
|
|||||||
|
|
||||||
if [ -n "$addr" -a -n "$CONNTRACK_MATCH" ]; then
|
if [ -n "$addr" -a -n "$CONNTRACK_MATCH" ]; then
|
||||||
match='--ctorigdst'
|
match='--ctorigdst'
|
||||||
if [ -n "$NEW_CONNTRACK_MATCH" ]; then
|
if [ -z "$OLD_CONNTRACK_MATCH" ]; then
|
||||||
case $adr in
|
case $adr in
|
||||||
!*)
|
!*)
|
||||||
match='!--ctorigdst'
|
match='!--ctorigdst'
|
||||||
@ -1951,7 +1951,7 @@ __EOF__
|
|||||||
else
|
else
|
||||||
for adr in $(separate_list $addr); do
|
for adr in $(separate_list $addr); do
|
||||||
match='--ctorigdst'
|
match='--ctorigdst'
|
||||||
if [ -n "$NEW_CONNTRACK_MATCH" ]; then
|
if [ -z "$OLD_CONNTRACK_MATCH" ]; then
|
||||||
case $adr in
|
case $adr in
|
||||||
!*)
|
!*)
|
||||||
match='!--ctorigdst'
|
match='!--ctorigdst'
|
||||||
@ -2028,7 +2028,7 @@ __EOF__
|
|||||||
if [ -n "$addr" ]; then
|
if [ -n "$addr" ]; then
|
||||||
for adr in $(separate_list $addr); do
|
for adr in $(separate_list $addr); do
|
||||||
match='--ctorigdst'
|
match='--ctorigdst'
|
||||||
if [ -n "$NEW_CONNTRACK_MATCH" ]; then
|
if [ -z "$OLD_CONNTRACK_MATCH" ]; then
|
||||||
case $adr in
|
case $adr in
|
||||||
!*)
|
!*)
|
||||||
match='!--ctorigdst'
|
match='!--ctorigdst'
|
||||||
@ -3822,7 +3822,7 @@ __EOF__
|
|||||||
# We have connection tracking match -- match on the original destination
|
# We have connection tracking match -- match on the original destination
|
||||||
#
|
#
|
||||||
match='--ctorigdst'
|
match='--ctorigdst'
|
||||||
if [ -n "$NEW_CONNTRACK_MATCH" ]; then
|
if [ -z "$OLD_CONNTRACK_MATCH" ]; then
|
||||||
case $network in
|
case $network in
|
||||||
!*)
|
!*)
|
||||||
match='!--ctorigdst'
|
match='!--ctorigdst'
|
||||||
@ -5148,6 +5148,7 @@ compile_firewall() # $1 = File Name
|
|||||||
[ -d $outfile ] && fatal_error "$outfile is a Directory"
|
[ -d $outfile ] && fatal_error "$outfile is a Directory"
|
||||||
[ -h $outfile ] && fatal_error "$outfile is a Symbolic Link"
|
[ -h $outfile ] && fatal_error "$outfile is a Symbolic Link"
|
||||||
[ -f $outfile -a ! -x $outfile ] && fatal_error "$outfile exists and is not a restore file"
|
[ -f $outfile -a ! -x $outfile ] && fatal_error "$outfile exists and is not a restore file"
|
||||||
|
[ $(basename $1) = shorewall ] && fatal_error "A compiled script may not be named 'shorewall'"
|
||||||
|
|
||||||
DOING=Compiling
|
DOING=Compiling
|
||||||
DONE=compiled
|
DONE=compiled
|
||||||
|
@ -55,16 +55,13 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
COMMAND="$1"
|
||||||
usage 2
|
|
||||||
else
|
|
||||||
COMMAND="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -n "${PRODUCT:=Shorewall}" ]
|
[ -n "${PRODUCT:=Shorewall}" ]
|
||||||
|
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
start)
|
start)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
if shorewall_is_started; then
|
if shorewall_is_started; then
|
||||||
error_message "$PRODUCT is already Running"
|
error_message "$PRODUCT is already Running"
|
||||||
status=0
|
status=0
|
||||||
@ -80,6 +77,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
progress_message3 "Stopping $PRODUCT...."
|
progress_message3 "Stopping $PRODUCT...."
|
||||||
stop_firewall
|
stop_firewall
|
||||||
status=0
|
status=0
|
||||||
@ -90,16 +88,32 @@ case "$COMMAND" in
|
|||||||
if ! shorewall_is_started ; then
|
if ! shorewall_is_started ; then
|
||||||
error_message "$PRODUCT is not running"
|
error_message "$PRODUCT is not running"
|
||||||
status=2
|
status=2
|
||||||
else
|
elif [ $# -eq 1 ]; then
|
||||||
$IPTABLES -Z
|
$IPTABLES -Z
|
||||||
$IPTABLES -t nat -Z
|
$IPTABLES -t nat -Z
|
||||||
$IPTABLES -t mangle -Z
|
$IPTABLES -t mangle -Z
|
||||||
date > ${VARDIR}/restarted
|
date > ${VARDIR}/restarted
|
||||||
status=0
|
status=0
|
||||||
progress_message3 "$PRODUCT Counters Reset"
|
progress_message3 "$PRODUCT Counters Reset"
|
||||||
|
else
|
||||||
|
status=0
|
||||||
|
for chain in $@; do
|
||||||
|
if chain_exists $chain; then
|
||||||
|
if qt $IPTABLES -Z $chain; then
|
||||||
|
progress_message3 "Filter table $chain Counters Reset"
|
||||||
|
else
|
||||||
|
error_message "ERROR: Reset of chain $chain failed"
|
||||||
|
status=2
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
error_message "WARNING: Filter Chain $chain does not exist"
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
if shorewall_is_started; then
|
if shorewall_is_started; then
|
||||||
progress_message3 "Restarting $PRODUCT...."
|
progress_message3 "Restarting $PRODUCT...."
|
||||||
else
|
else
|
||||||
@ -120,6 +134,7 @@ case "$COMMAND" in
|
|||||||
progress_message3 "done."
|
progress_message3 "done."
|
||||||
;;
|
;;
|
||||||
refresh)
|
refresh)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
if shorewall_is_started; then
|
if shorewall_is_started; then
|
||||||
progress_message3 "Refreshing $PRODUCT...."
|
progress_message3 "Refreshing $PRODUCT...."
|
||||||
refresh_firewall
|
refresh_firewall
|
||||||
@ -131,6 +146,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
restore)
|
restore)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
restore_firewall
|
restore_firewall
|
||||||
status=$?
|
status=$?
|
||||||
if [ -n "$SUBSYSLOCK" ]; then
|
if [ -n "$SUBSYSLOCK" ]; then
|
||||||
@ -138,6 +154,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
clear)
|
clear)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
progress_message3 "Clearing $PRODUCT...."
|
progress_message3 "Clearing $PRODUCT...."
|
||||||
clear_firewall
|
clear_firewall
|
||||||
status=0
|
status=0
|
||||||
@ -145,6 +162,7 @@ case "$COMMAND" in
|
|||||||
progress_message3 "done."
|
progress_message3 "done."
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)"
|
echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)"
|
||||||
echo
|
echo
|
||||||
if shorewall_is_started; then
|
if shorewall_is_started; then
|
||||||
@ -169,10 +187,12 @@ case "$COMMAND" in
|
|||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
version)
|
version)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
echo $VERSION
|
echo $VERSION
|
||||||
status=0
|
status=0
|
||||||
;;
|
;;
|
||||||
help)
|
help)
|
||||||
|
[ $# -ne 1 ] && usage 2
|
||||||
usage 0
|
usage 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
Reference in New Issue
Block a user