Compare commits

..

50 Commits

Author SHA1 Message Date
Tom Eastep
7798c52a19 Fix DOCKER=Yes when docker0 is defined and Docker isn't started.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-22 17:50:51 -07:00
Tom Eastep
2809d6896c Clarify dynamic sub-zones
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-18 08:20:23 -07:00
Tom Eastep
1d066bdfa4 Minor updates to the Shorewall 5 article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-18 08:19:47 -07:00
Tom Eastep
9b7088158b Correct ipv6-route header number
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-10 07:12:01 -07:00
Tom Eastep
625d763372 Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code
Conflicts:
	Shorewall/Perl/Shorewall/Config.pm
2016-05-07 13:50:01 -07:00
Tom Eastep
82169a0bfd Use 'date' format for compiletime rather than localtime format
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-07 13:48:16 -07:00
Tom Eastep
0d16b2820a Use 'date' format for compiletime rather than localtime format
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-06 13:28:22 -07:00
Tom Eastep
d4df67966d Turn on AUTOMAKE in the sample configurations
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-06 08:46:11 -07:00
Tom Eastep
f16bb887f3 Report versions as Shorewall's rather than Shorewall6's
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-05 15:41:46 -07:00
Tom Eastep
64fb662bb1 Verify Shorewall6 version when compiling for IPv6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-05 15:22:47 -07:00
Tom Eastep
ce20e5592b Cross-check core and standard versions during compilation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-05 13:53:26 -07:00
Tom Eastep
590243a787 Add NFLOG as a supported mangle action
- Also document nflog-parameters
- Correct range of nflog groups

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-03 11:27:34 -07:00
Tom Eastep
9dd0346987 Apply Paul Gear's patch for Ubuntu 16.04
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-02 07:25:37 -07:00
Tom Eastep
ccfa181a6d Tweak compile_info_command()
- Fix comment
- use $globals{VERSION} for the version number

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-30 14:12:34 -07:00
Tom Eastep
d959fd4445 Fix link
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-30 08:37:20 -07:00
Tom Eastep
b7de785396 Correct typo in manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-30 08:34:43 -07:00
Tom Eastep
24d40f4cc2 Add VERBOSE_MESSAGES option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-30 08:00:56 -07:00
Tom Eastep
244f2cefe5 Update comment describing info_command()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-29 15:42:48 -07:00
Tom Eastep
ec23ca67f8 Remove the parentheses from around the start/stop time
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-29 15:32:17 -07:00
Tom Eastep
a2345325dd Move show_status() to before its first reference
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-29 15:31:55 -07:00
Tom Eastep
1308560aba Display compilation date/time in 'status -a' output
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-29 14:12:53 -07:00
Tom Eastep
41923cb80e Improve compile time/date implementation
- Rename the command from 'date' to 'info'
- Return the complete date/time/version string in the command

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-29 12:31:17 -07:00
Tom Eastep
2a40012fc4 Include compile time and date in the output of 'shorewall status'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-27 16:25:21 -07:00
Matt Darfeuille
05a15c6f8b patches and request
Tom,

Some patches for the trunk repo(fixes.patch):

Patch1: Fix a typo in the path being printed for the standard actions
file.
Patch2: Will only install the shorewall's manpages if the variable
MANDIR is none-empty(I did it only for the sake of completeness)!
Patch3: Will only install the shorewall-lite's manpages if the
variable MANDIR is none-empty.
Patch4: Correct multiple product name's typos in
shorewall-init/install.sh.
Patch5: Remove ~/.shorewallrc when shorewall-core is uninstalled.

And two other  patches for the release repo(changelog-1.patch):

Patch1: Changed restart to reload for the line: 'Update DHCP
article(refresh -> restart).
Patch2: Rephrased the line for the newly added ?WARNING and ?INFO
directives.

Request:
Could the date of the compiled firewall script also be displayed when
'shorewall status' is executed?

-Matt

-------------- Enclosure number 2 ----------------
>From a5ae24bbe9b25aefdbcc4d7c8e5d013a36b03078 Mon Sep 17 00:00:00 2001
From: Matt Darfeuille <matdarf@gmail.com>
Date: Sat, 23 Apr 2016 14:44:19 +0200
Subject: [PATCH 1/5] Fix typo in printed path for standard actions file

Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-27 15:07:44 -07:00
Tom Eastep
a92d10f19c Merge branch '5.0.8' 2016-04-27 10:23:51 -07:00
Tom Eastep
47edfaf093 Create standard error messages in the CLI
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-27 10:13:24 -07:00
Tom Eastep
67c2587890 Correct typos in the Events article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-25 16:09:10 -07:00
Tom Eastep
f6b7eb4ea0 Correct handling of persistent provider with no IP address
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-25 12:27:00 -07:00
Tom Eastep
200ad3f874 Correct typos in the Events article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-25 09:00:45 -07:00
Tom Eastep
800c06e8c9 Rename lib.core to lib.runtime
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-21 08:12:41 -07:00
Tom Eastep
f16e3f1fbe Issue warning when enable/disable won't work correctly
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-19 10:42:50 -07:00
Tom Eastep
71bd7a4647 Update the STARTUP_LOG description in shorewall[6].conf
- Update list of commands

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-19 07:49:37 -07:00
Tom Eastep
ab95607f5f Document ?WARNING and ?INFO
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 14:47:08 -07:00
Tom Eastep
f9bbca8b05 Expand the list of commands that write to STARTUP_LOG
- add the safe-* commands

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 14:16:13 -07:00
Tom Eastep
0faf3b6db1 Send INFO messages to STDERR rather than STDOUT 2016-04-18 13:59:29 -07:00
Tom Eastep
3253c882e9 Merge branch '5.0.8' 2016-04-18 12:36:28 -07:00
Tom Eastep
5212dba7cb Add an ESTABLISHED,RELATED rule for docker0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 10:13:05 -07:00
Tom Eastep
35a22eedac Reword error message when tcclass MARK is too large
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 10:06:04 -07:00
Tom Eastep
2b7ef0fe32 Update the tcclasses manpage to discuss fw mark filter priority
- Also correct default priorities for tos= and tcp-ack

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 09:18:48 -07:00
Tom Eastep
b53de922d1 Catch 0 in the MARK column of the tcclasses file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-18 08:50:10 -07:00
Matt Darfeuille
365ffaf645 questions
On 17 Apr 2016 at 7:45, Tom Eastep wrote:

> On 04/17/2016 06:23 AM, Matt Darfeuille wrote:
>
> >> Tom, I neglected the git part of that request!(sorry):
> >>
> >> Could changes be also made in the git code repo that take for account
> >> case insensitive system?:
> >>
> >> What I suggest doing is using the deprecated extension when the case
> >> of a file is changed in the code so git wouldn't show 'Modified: ...'
> >> and simply modifying shorewall/install.sh to strip the file from the
> >> deprecated extension and then copying it to the deprecated directory.
> >>
> >> In other words: when changing the case of a file tracked by git could
> >> case-insensitivity platform be taken in to account?
> >>
> >> -Matt
> >>
> >> P.S. I'll test SW_LOGGERTAG tomorrow!!!:)
> >
> > Or do you have a better solution, if no, I could do the changes to
> > shorewall/install.sh!?
>
> Sure -- go ahead. We'll do it in the master branch, though, since I've
> now created a 5.0.8 branch for the upcoming release.
>
> >
> > You might want to apply the attached patch to changelog.txt in the
> > release repo!
> >
>
> Applied -- thanks!
>
> -Tom
> --
> Tom Eastep        \ When I die, I want to go like my Grandfather who
> Shoreline,         \ died peacefully in his sleep. Not screaming like
> Washington, USA     \ all of the passengers in his car
> http://shorewall.net \________________________________________________
>
>

Attached as case.patch are 3 patches:

1 and 2 simply rename the deprecated files(adding .deprecated)

Patch 3 will modify Shorewall/install.sh to reflect the new naming
scheme!

I didn't have the time to test SW_LOGGERTAG but will do so in the
coming days!!!:)

-Matt

-------------- Enclosure number 1 ----------------
From 2ecd761b414af61c5854d6427fb9ec8ab1365c7b Mon Sep 17 00:00:00 2001
From: Matt Darfeuille <matdarf@gmail.com>
Date: Sun, 17 Apr 2016 18:34:40 +0200
Subject: [PATCH 1/3] Rename macro.SNMPTrap to macro.SNMPTrap.deprecated

Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-17 13:50:17 -07:00
Tom Eastep
ae852b513d Correct indentation issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-17 10:23:18 -07:00
Tom Eastep
9611b588e3 Use a uniform format for log timestamps
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:52:35 -07:00
Tom Eastep
eb95532248 Enable compiler logging on reload and restart
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:52:17 -07:00
Tom Eastep
fb8dbcf44b Use a uniform format for log timestamps
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:49:38 -07:00
Tom Eastep
62a14aab28 Enable compiler logging on reload and restart
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:37:42 -07:00
Tom Eastep
335f2968f8 Implement ?INFO and ?WARNING
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-16 09:20:09 -07:00
Tom Eastep
32f888a7d4 Add an ENVIRONMENT section to the CLI manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 15:41:55 -07:00
Tom Eastep
c725372639 Correct logging of 'reloaded' message
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 14:46:21 -07:00
Tom Eastep
524838ae47 Implement $SW_LOGGERTAG
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-04-15 14:29:51 -07:00
49 changed files with 812 additions and 259 deletions

View File

@@ -731,12 +731,29 @@ list_zone() {
done done
} }
option_error() {
fatal_error "The $COMMAND command does not accept this option: -$1"
}
too_many_arguments() {
fatal_error "Too many arguments: $1"
}
missing_argument() {
fatal_error "Missing argument"
}
missing_option_value() {
fatal_error "The $1 option requires a value"
}
version_command() { version_command() {
local finished local finished
finished=0 finished=0
local all local all
all= all=
local product local product
local compiletime
while [ $finished -eq 0 -a $# -gt 0 ]; do while [ $finished -eq 0 -a $# -gt 0 ]; do
option=$1 option=$1
@@ -755,7 +772,7 @@ version_command() {
option=${option#a} option=${option#a}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -767,7 +784,7 @@ version_command() {
esac esac
done done
[ $# -gt 0 ] && usage 1 [ $# -gt 0 ] && too_many_arguments
if [ -n "$all" ]; then if [ -n "$all" ]; then
echo "shorewall-core: $(cat ${SHAREDIR}/shorewall/coreversion)" echo "shorewall-core: $(cat ${SHAREDIR}/shorewall/coreversion)"
@@ -779,8 +796,16 @@ version_command() {
done done
if [ "$(id -u)" -eq 0 -a -f $g_firewall ]; then if [ "$(id -u)" -eq 0 -a -f $g_firewall ]; then
echo $g_echo_n "$g_firewall was compiled by Shorewall version " compiletime=$(run_it $g_firewall info 2>/dev/null)
$g_firewall version
case $compiletime in
compiled\ *)
echo "$g_firewall was $compiletime"
;;
*)
echo "$g_firewall was compiled by Shorewall version $(run_it $g_firewall version))"
;;
esac
fi fi
else else
echo $SHOREWALL_VERSION echo $SHOREWALL_VERSION
@@ -1065,7 +1090,7 @@ show_connections() {
shift shift
conntrack -f ipv4 -L $@ | show_connections_filter conntrack -f ipv4 -L $@ | show_connections_filter
else else
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments
if [ -f /proc/net/ip_conntrack ]; then if [ -f /proc/net/ip_conntrack ]; then
cat /proc/net/ip_conntrack | show_connections_filter cat /proc/net/ip_conntrack | show_connections_filter
else else
@@ -1078,7 +1103,7 @@ show_connections() {
echo echo
conntrack -f ipv6 -L $@ | show_connections_filter conntrack -f ipv6 -L $@ | show_connections_filter
else else
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments
if [ -f /proc/sys/net/netfilter/nf_conntrack_count -a -f /proc/sys/net/nf_conntrack ]; then if [ -f /proc/sys/net/netfilter/nf_conntrack_count -a -f /proc/sys/net/nf_conntrack ]; then
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count) local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max) local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
@@ -1199,7 +1224,7 @@ show_command() {
option=${option#f} option=${option#f}
;; ;;
t) t)
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && missing_option_value -t
case $2 in case $2 in
mangle|nat|filter|raw|rawpost) mangle|nat|filter|raw|rawpost)
@@ -1227,7 +1252,7 @@ show_command() {
option=${option#b} option=${option#b}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -1249,37 +1274,37 @@ show_command() {
eval show_connections $@ $g_pager eval show_connections $@ $g_pager
;; ;;
nat) nat)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_nat $g_pager eval show_nat $g_pager
;; ;;
raw) raw)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_raw $g_pager eval show_raw $g_pager
;; ;;
rawpost) rawpost)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_rawpost $g_pager eval show_rawpost $g_pager
;; ;;
tos|mangle) tos|mangle)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_mangle $g_pager eval show_mangle $g_pager
;; ;;
log) log)
[ $# -gt 2 ] && usage 1 [ $# -gt 2 ] && too_many_arguments $2
setup_logread setup_logread
eval show_log $g_pager eval show_log $g_pager
;; ;;
tc) tc)
[ $# -gt 2 ] && usage 1 [ $# -gt 2 ] && too_many_arguments $2
eval show_tc $@ $g_pager eval show_tc $@ $g_pager
;; ;;
classifiers|filters) classifiers|filters)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_classifiers_command $g_pager eval show_classifiers_command $g_pager
;; ;;
zones) zones)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
if [ -f ${VARDIR}/zones ]; then if [ -f ${VARDIR}/zones ]; then
echo "$g_product $SHOREWALL_VERSION Zones at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Zones at $g_hostname - $(date)"
echo echo
@@ -1302,7 +1327,7 @@ show_command() {
fi fi
;; ;;
capabilities) capabilities)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
determine_capabilities determine_capabilities
VERBOSITY=2 VERBOSITY=2
if [ -n "$g_filemode" ]; then if [ -n "$g_filemode" ]; then
@@ -1312,11 +1337,11 @@ show_command() {
fi fi
;; ;;
ip) ip)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_ip_addresses $g_pager eval show_ip_addresses $g_pager
;; ;;
routing) routing)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_routing_command $g_pager eval show_routing_command $g_pager
;; ;;
config) config)
@@ -1345,26 +1370,26 @@ show_command() {
echo $VARDIR; echo $VARDIR;
;; ;;
policies) policies)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_policies $g_pager eval show_policies $g_pager
;; ;;
ipa) ipa)
[ $g_family -eq 4 ] || usage 1 [ $g_family -eq 4 ] || fatal_error "'show ipa' is now available in $g_product"
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_ipa $g_pager eval show_ipa $g_pager
;; ;;
marks) marks)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
echo "$g_product $SHOREWALL_VERSION Mark Layout at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Mark Layout at $g_hostname - $(date)"
echo echo
[ -f ${VARDIR}/marks ] && cat ${VARDIR}/marks; [ -f ${VARDIR}/marks ] && cat ${VARDIR}/marks;
;; ;;
nfacct) nfacct)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_nfacct_command $g_pager eval show_nfacct_command $g_pager
;; ;;
arptables) arptables)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
resolve_arptables resolve_arptables
if [ -n "$arptables" -a -x $arptables ]; then if [ -n "$arptables" -a -x $arptables ]; then
eval show_arptables $g_pager eval show_arptables $g_pager
@@ -1373,22 +1398,22 @@ show_command() {
fi fi
;; ;;
event) event)
[ $# -gt 1 ] || usage 1 [ $# -gt 1 ] || too_many_arguments $2
echo "$g_product $SHOREWALL_VERSION events at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION events at $g_hostname - $(date)"
echo echo
shift shift
show_events $@ show_events $@
;; ;;
events) events)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_events_command $g_pager eval show_events_command $g_pager
;; ;;
bl|blacklists) bl|blacklists)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_blacklists $g_pager eval show_blacklists $g_pager
;; ;;
opens) opens)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
echo "$g_product $SHOREWALL_VERSION Temporarily opened connections at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Temporarily opened connections at $g_hostname - $(date)"
if chain_exists dynamic; then if chain_exists dynamic; then
@@ -1404,12 +1429,12 @@ show_command() {
*) *)
case $1 in case $1 in
actions) actions)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_actions_sorted $g_pager eval show_actions_sorted $g_pager
return return
;; ;;
macro) macro)
[ $# -ne 2 ] && usage 1 [ $# -ne 2 ] && too_many_arguments $2
for directory in $(split $CONFIG_PATH); do for directory in $(split $CONFIG_PATH); do
if [ -f ${directory}/macro.$2 ]; then if [ -f ${directory}/macro.$2 ]; then
echo "Shorewall $SHOREWALL_VERSION Macro $2 at $g_hostname - $(date)" echo "Shorewall $SHOREWALL_VERSION Macro $2 at $g_hostname - $(date)"
@@ -1421,7 +1446,7 @@ show_command() {
return return
;; ;;
macros) macros)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && too_many_arguments $2
eval show_macros $g_pager eval show_macros $g_pager
return return
;; ;;
@@ -1432,7 +1457,7 @@ show_command() {
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [ $1 = dynamic -a $# -gt 1 ]; then if [ $1 = dynamic -a $# -gt 1 ]; then
shift shift
[ $# -eq 1 ] || usage 1 [ $# -eq 1 ] || too_many_arguments $2
list_zone $1 list_zone $1
return; return;
fi fi
@@ -1507,6 +1532,49 @@ dump_filter_wrapper() {
eval dump_filter $g_pager eval dump_filter $g_pager
} }
show_status() {
local compiletime
local state
if product_is_started ; then
[ $VERBOSITY -ge 1 ] && echo "$g_product is running"
status=0
else
[ $VERBOSITY -ge 1 ] && echo "$g_product is stopped"
status=4
fi
if [ -f ${VARDIR}/state ]; then
state="$(cat ${VARDIR}/state)"
case $state in
Stopped*|Closed*|Clear*)
status=3
;;
esac
else
state=Unknown
fi
if [ $VERBOSITY -ge 1 ]; then
if [ -f $g_firewall ]; then
compiletime=$(run_it $g_firewall info 2>/dev/null)
case $compiletime in
compiled\ *)
state="$state ($g_firewall $compiletime)"
;;
*)
state="$state ($g_firewall compiled by Shorewall version $(run_it $g_firewall version))"
;;
esac
fi
echo "State:$state"
echo
fi
}
# #
# Dump Command Executor # Dump Command Executor
# #
@@ -1546,7 +1614,7 @@ do_dump_command() {
option=${option#c} option=${option#c}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -1565,7 +1633,7 @@ do_dump_command() {
[ $VERBOSITY -lt 2 ] && VERBOSITY=2 [ $VERBOSITY -lt 2 ] && VERBOSITY=2
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || too_many_arguments $1
clear_term clear_term
echo "$g_product $SHOREWALL_VERSION Dump at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
echo echo
@@ -1760,7 +1828,7 @@ restore_command() {
option=${option#C} option=${option#C}
;; ;;
*) *)
usage 1 option_error
;; ;;
esac esac
done done
@@ -1780,7 +1848,7 @@ restore_command() {
validate_restorefile '<restore file>' validate_restorefile '<restore file>'
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -2386,7 +2454,7 @@ hits_command() {
option=${option#t} option=${option#t}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -2398,7 +2466,7 @@ hits_command() {
esac esac
done done
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || too_many_arguments $1
clear_term clear_term
echo "$g_product $SHOREWALL_VERSION Hits at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
@@ -2455,7 +2523,7 @@ hits_command() {
# #
allow_command() { allow_command() {
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && missing_argument
if product_is_started ; then if product_is_started ; then
local which local which
which='-s' which='-s'
@@ -2525,8 +2593,6 @@ logwatch_command() {
-*) -*)
option=${option#-} option=${option#-}
[ -z "$option" ] && usage 1
while [ -n "$option" ]; do while [ -n "$option" ]; do
case $option in case $option in
v*) v*)
@@ -2546,7 +2612,7 @@ logwatch_command() {
option= option=
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -2565,7 +2631,7 @@ logwatch_command() {
elif [ $# -eq 0 ]; then elif [ $# -eq 0 ]; then
logwatch 30 logwatch 30
else else
usage 1 too_many_arguments $2
fi fi
} }
@@ -3309,36 +3375,6 @@ report_capabilities1() {
report_capabilities_unsorted1 | sort report_capabilities_unsorted1 | sort
} }
show_status() {
if product_is_started ; then
[ $VERBOSITY -ge 1 ] && echo "$g_product is running"
status=0
else
[ $VERBOSITY -ge 1 ] && echo "$g_product is stopped"
status=4
fi
if [ -f ${VARDIR}/state ]; then
state="$(cat ${VARDIR}/state)"
case $state in
Stopped*|Closed*|Clear*)
status=3
;;
esac
else
state=Unknown
fi
if [ $VERBOSITY -ge 1 ]; then
if [ -f $g_firewall ]; then
state="$state ($g_firewall compiled by Shorewall version $($g_firewall version))"
fi
echo "State:$state"
echo
fi
}
interface_status() { interface_status() {
case $(cat $1) in case $(cat $1) in
0) 0)
@@ -3392,7 +3428,7 @@ status_command() {
option=${option#i} option=${option#i}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -3404,7 +3440,7 @@ status_command() {
esac esac
done done
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || missing_argument
[ $VERBOSITY -ge 1 ] && echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)" && echo [ $VERBOSITY -ge 1 ] && echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)" && echo
show_status show_status
@@ -3498,7 +3534,7 @@ save_command() {
option=${option#C} option=${option#C}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -3518,7 +3554,7 @@ save_command() {
validate_restorefile '<restore file>' validate_restorefile '<restore file>'
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -3537,6 +3573,9 @@ save_command() {
forget_command() { forget_command() {
case $# in case $# in
0)
missing_argument
;;
1) 1)
;; ;;
2) 2)
@@ -3544,7 +3583,7 @@ forget_command() {
validate_restorefile '<restore file>' validate_restorefile '<restore file>'
;; ;;
*) *)
usage 1 too_many_arguments $3
;; ;;
esac esac
@@ -3566,7 +3605,7 @@ ipcalc_command() {
local address local address
local vlsm local vlsm
[ $g_family -eq 6 ] && usage 1 [ $g_family -eq 6 ] && fatal_error "$g_product does not support the ipcalc command"
if [ $# -eq 2 ]; then if [ $# -eq 2 ]; then
address=${2%/*} address=${2%/*}
@@ -3574,13 +3613,15 @@ ipcalc_command() {
elif [ $# -eq 3 ]; then elif [ $# -eq 3 ]; then
address=$2 address=$2
vlsm=$(ip_vlsm $3) vlsm=$(ip_vlsm $3)
elif [ $# -eq 0 ]; then
missing_argument
else else
usage 1 too_many_arguments $4
fi fi
valid_address $address || fatal_error "Invalid IP address: $address" valid_address $address || fatal_error "Invalid IP address: $address"
[ -z "$vlsm" ] && usage 2 [ -z "$vlsm" ] && fatal_error "Missing VLSM"
[ "x$address" = "x$vlsm" ] && usage 2 [ "x$address" = "x$vlsm" ] && "Invalid VLSM"
[ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm" [ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm"
address=$address/$vlsm address=$address/$vlsm
@@ -3594,7 +3635,7 @@ ipcalc_command() {
iprange_command() { iprange_command() {
local range local range
[ $g_family -eq 6 ] && usage 1 [ $g_family -eq 6 ] && fatal_error "$g_product does not support the iprange command"
range='' range=''
@@ -3612,15 +3653,19 @@ iprange_command() {
ip_range $range ip_range $range
;; ;;
*) *)
usage 1 fatal_error "Invalid ip range: $range"
;; ;;
esac esac
} }
ipdecimal_command() { ipdecimal_command() {
[ $# -eq 2 ] || usage 1 if [ $# eq 1 ]; then
missing_argument
else
[ $# -eq 2 ] || too_many_arguments $3
fi
[ $g_family -eq 6 ] && usage 1 [ $g_family -eq 6 ] && fatal_error "$g_product does not support the iprange command"
case $2 in case $2 in
*.*.*.*) *.*.*.*)
@@ -3882,7 +3927,7 @@ start_command() {
rc=$? rc=$?
else else
error_message "${VARDIR}/firewall is missing or is not executable" error_message "${VARDIR}/firewall is missing or is not executable"
logger -p kern.err "ERROR:$g_product start failed" mylogger kern.err "ERROR:$g_product start failed"
rc=6 rc=6
fi fi
@@ -3928,7 +3973,7 @@ start_command() {
option=${option%p} option=${option%p}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -3944,7 +3989,7 @@ start_command() {
0) 0)
;; ;;
*) *)
usage 1 too_many_arguments $1
;; ;;
esac esac
@@ -3988,7 +4033,7 @@ restart_command() {
option=${option#C} option=${option#C}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -4004,7 +4049,7 @@ restart_command() {
0) 0)
;; ;;
*) *)
usage 1 too_many_arguments $1
;; ;;
esac esac
@@ -4015,7 +4060,7 @@ restart_command() {
rc=$? rc=$?
else else
error_message "${VARDIR}/firewall is missing or is not executable" error_message "${VARDIR}/firewall is missing or is not executable"
logger -p kern.err "ERROR:$g_product $COMMAND failed" mylogger kern.err "ERROR:$g_product $COMMAND failed"
rc=6 rc=6
fi fi
@@ -4220,7 +4265,8 @@ shorewall_cli() {
while [ -n "$option" ]; do while [ -n "$option" ]; do
case $option in case $option in
c) c)
[ $# -eq 1 -o -n "$g_lite" ] && usage 1 [ $# -eq 1 ] && missing_option_value -c
[ -n "$g_lite" ] && fatal_error "$g_product does not support the -c option"
if [ ! -d $2 ]; then if [ ! -d $2 ]; then
if [ -e $2 ]; then if [ -e $2 ]; then
@@ -4235,7 +4281,7 @@ shorewall_cli() {
shift shift
;; ;;
e*) e*)
[ -n "$g_lite" ] && usage 1 [ -n "$g_lite" ] && fatal_error "$g_product does not support the -e option"
g_export=Yes g_export=Yes
option=${option#e} option=${option#e}
;; ;;
@@ -4297,7 +4343,7 @@ shorewall_cli() {
option= option=
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -4362,7 +4408,7 @@ shorewall_cli() {
start_command $@ start_command $@
;; ;;
stop|clear) stop|clear)
[ $# -ne 1 ] && usage 1 [ $# -ne 1 ] && too_many_arguments $2
get_config get_config
[ -x $g_firewall ] || fatal_error "$g_product has never been started" [ -x $g_firewall ] || fatal_error "$g_product has never been started"
[ -n "$g_nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
@@ -4419,7 +4465,7 @@ shorewall_cli() {
dump_command $@ dump_command $@
;; ;;
hits) hits)
[ $g_family -eq 6 ] && usage 1 [ $g_family -eq 6 ] && fatal_error "$g_product does not support the hits command"
get_config Yes No Yes get_config Yes No Yes
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
shift shift
@@ -4437,19 +4483,19 @@ shorewall_cli() {
drop) drop)
get_config get_config
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && missing_argument
drop_command $@ drop_command $@
;; ;;
logdrop) logdrop)
get_config get_config
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && missing_argument
logdrop_command $@ logdrop_command $@
;; ;;
reject|logreject) reject|logreject)
get_config get_config
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && missing_argument
reject_command $@ reject_command $@
;; ;;
open|close) open|close)
@@ -4522,7 +4568,7 @@ shorewall_cli() {
run_it $g_firewall $g_debugging call $@ run_it $g_firewall $g_debugging call $@
fi fi
else else
usage 1 missing_argument
fi fi
;; ;;
help) help)
@@ -4540,7 +4586,7 @@ shorewall_cli() {
noiptrace_command $@ noiptrace_command $@
;; ;;
savesets) savesets)
[ $# -eq 1 ] || usage 1 [ $# -eq 1 ] || too_many_arguments $2
get_config get_config
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
savesets1 savesets1
@@ -4549,7 +4595,7 @@ shorewall_cli() {
if [ -z "$g_lite" ]; then if [ -z "$g_lite" ]; then
compiler_command $@ compiler_command $@
else else
usage 1 fatal_error "Invalid command: $COMMAND"
fi fi
;; ;;
esac esac

View File

@@ -25,6 +25,22 @@
# scripts rather than loaded at run-time. # scripts rather than loaded at run-time.
# #
######################################################################################### #########################################################################################
#
# Wrapper around logger that sets the tag according to $SW_LOGGERTAG
#
mylogger() {
local level
level=$1
shift
if [ -n "$SW_LOGGERTAG" ]; then
logger -p $level -t "$SW_LOGGERTAG" $*
else
logger -p $level $*
fi
}
# #
# Issue a message and stop # Issue a message and stop
# #
@@ -39,13 +55,13 @@ startup_error() # $* = Error Message
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed" mylogger kern.err "ERROR:$g_product start failed:Firewall state not changed"
;; ;;
restart) restart)
logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed" mylogger kern.err "ERROR:$g_product restart failed:Firewall state not changed"
;; ;;
restore) restore)
logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed" mylogger kern.err "ERROR:$g_product restore failed:Firewall state not changed"
;; ;;
esac esac
@@ -696,9 +712,9 @@ find_file()
set_state () # $1 = state set_state () # $1 = state
{ {
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then
echo "$1 ($(date)) from $2" > ${VARDIR}/state echo "$1 $(date) from $2" > ${VARDIR}/state
else else
echo "$1 ($(date))" > ${VARDIR}/state echo "$1 $(date)" > ${VARDIR}/state
fi fi
} }

View File

@@ -117,6 +117,7 @@ fi
echo "Uninstalling Shorewall Core $VERSION" echo "Uninstalling Shorewall Core $VERSION"
rm -rf ${SHAREDIR}/shorewall rm -rf ${SHAREDIR}/shorewall
rm -f ~/.shorewallrc
echo "Shorewall Core Uninstalled" echo "Shorewall Core Uninstalled"

View File

@@ -572,9 +572,9 @@ if [ -z "$DESTDIR" ]; then
cant_autostart cant_autostart
fi fi
elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then
/etc/init.d/shorewall-inir enable /etc/init.d/$PRODUCT enable
if /etc/init.d/shorewall-init enabled; then if /etc/init.d/shorewall-init enabled; then
echo "Shorrewall Init will start automatically at boot" echo "$Product will start automatically at boot"
else else
cant_autostart cant_autostart
fi fi

View File

@@ -495,7 +495,7 @@ done
# Install the Man Pages # Install the Man Pages
# #
if [ -d manpages ]; then if [ -d manpages -a -n "$MANDIR" ]; then
cd manpages cd manpages
mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/ mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/

View File

@@ -1585,6 +1585,34 @@
started.</para> started.</para>
</refsect1> </refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by Shorewall-lite:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1> <refsect1>
<title>FILES</title> <title>FILES</title>

View File

@@ -244,7 +244,7 @@ sub create_arptables_load( $ ) {
emit "exec 3>\${VARDIR}/.arptables-input"; emit "exec 3>\${VARDIR}/.arptables-input";
my $date = localtime; my $date = compiletime;
unless ( $test ) { unless ( $test ) {
emit_unindented '#'; emit_unindented '#';
@@ -294,7 +294,7 @@ sub create_arptables_load( $ ) {
# #
sub preview_arptables_load() { sub preview_arptables_load() {
my $date = localtime; my $date = compiletime;
print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n"; print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n";

View File

@@ -8500,7 +8500,7 @@ sub create_load_ipsets() {
emit ( 'fi' , emit ( 'fi' ,
'' ); '' );
} else { } else {
emit ' true'; emit 'true';
} }
pop_indent; pop_indent;
@@ -8575,7 +8575,7 @@ sub create_netfilter_load( $ ) {
enter_cat_mode; enter_cat_mode;
my $date = localtime; my $date = compiletime;
unless ( $test ) { unless ( $test ) {
emit_unindented '#'; emit_unindented '#';
@@ -8683,7 +8683,7 @@ sub preview_netfilter_load() {
enter_cat_mode1; enter_cat_mode1;
my $date = localtime; my $date = compiletime;
print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n"; print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n";
@@ -8919,7 +8919,7 @@ sub create_stop_load( $ ) {
enter_cat_mode; enter_cat_mode;
unless ( $test ) { unless ( $test ) {
my $date = localtime; my $date = compiletime;
emit_unindented '#'; emit_unindented '#';
emit_unindented "# Generated by Shorewall $globals{VERSION} - $date"; emit_unindented "# Generated by Shorewall $globals{VERSION} - $date";
emit_unindented '#'; emit_unindented '#';

View File

@@ -76,7 +76,7 @@ sub initialize_package_globals( $$$ ) {
# #
# First stage of script generation. # First stage of script generation.
# #
# Copy lib.core and lib.common to the generated script. # Copy lib.runtime and lib.common to the generated script.
# Generate the various user-exit jacket functions. # Generate the various user-exit jacket functions.
# #
# Note: This function is not called when $command eq 'check'. So it must have no side effects other # Note: This function is not called when $command eq 'check'. So it must have no side effects other
@@ -90,12 +90,12 @@ sub generate_script_1( $ ) {
if ( $test ) { if ( $test ) {
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall-perl\n#"; emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall-perl\n#";
} else { } else {
my $date = localtime; my $date = compiletime;
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#"; emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#";
copy $globals{SHAREDIRPL} . '/lib.core', 0; copy $globals{SHAREDIRPL} . '/lib.runtime', 0;
copy2 $globals{SHAREDIRPL} . '/lib.common', $debug; copy2 $globals{SHAREDIRPL} . '/lib.common' , $debug;
} }
} }
@@ -576,16 +576,16 @@ date > ${VARDIR}/restarted
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.info "$g_product started" mylogger kern.info "$g_product started"
;; ;;
reloaded) reload)
logger -p kern.info "$g_product reloaded" mylogger kern.info "$g_product reloaded"
;; ;;
refresh) refresh)
logger -p kern.info "$g_product refreshed" mylogger kern.info "$g_product refreshed"
;; ;;
restore) restore)
logger -p kern.info "$g_product restored" mylogger kern.info "$g_product restored"
;; ;;
esac esac
EOF EOF
@@ -596,6 +596,21 @@ EOF
} }
#
# Generate info_command()
#
sub compile_info_command() {
my $date = compiletime;
emit( "\n",
"#",
"# Echo the date and time when this script was compiled along with the Shorewall version",
"#",
"info_command() {" ,
qq( echo "compiled $date by Shorewall version $globals{VERSION}") ,
"}\n" );
}
# #
# The Compiler. # The Compiler.
# #
@@ -922,6 +937,10 @@ sub compiler {
# #
compile_updown; compile_updown;
# #
# Echo the compilation time and date
#
compile_info_command unless $test;
#
# Copy the footer to the script # Copy the footer to the script
# #
copy $globals{SHAREDIRPL} . 'prog.footer' unless $test; copy $globals{SHAREDIRPL} . 'prog.footer' unless $test;

View File

@@ -84,6 +84,8 @@ our @EXPORT = qw(
require_capability require_capability
report_used_capabilities report_used_capabilities
kernel_version kernel_version
compiletime
); );
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall); our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
@@ -681,6 +683,8 @@ our %ipsets; # All required IPsets
# #
our %filecache; our %filecache;
our $compiletime;
sub process_shorewallrc($$); sub process_shorewallrc($$);
sub add_variables( \% ); sub add_variables( \% );
# #
@@ -737,7 +741,7 @@ sub initialize( $;$$) {
TC_SCRIPT => '', TC_SCRIPT => '',
EXPORT => 0, EXPORT => 0,
KLUDGEFREE => '', KLUDGEFREE => '',
VERSION => "5.0.1", VERSION => "5.0.9-Beta2",
CAPVERSION => 50004 , CAPVERSION => 50004 ,
BLACKLIST_LOG_TAG => '', BLACKLIST_LOG_TAG => '',
RELATED_LOG_TAG => '', RELATED_LOG_TAG => '',
@@ -889,6 +893,7 @@ sub initialize( $;$$) {
DOCKER => undef , DOCKER => undef ,
PAGER => undef , PAGER => undef ,
MINIUPNPD => undef , MINIUPNPD => undef ,
VERBOSE_MESSAGES => undef ,
# #
# Packet Disposition # Packet Disposition
# #
@@ -1171,6 +1176,12 @@ sub initialize( $;$$) {
%shorewallrc1 = %shorewallrc unless $shorewallrc1; %shorewallrc1 = %shorewallrc unless $shorewallrc1;
add_variables %shorewallrc1; add_variables %shorewallrc1;
$compiletime = `date`;
chomp $compiletime;
$compiletime =~ s/ +/ /g;
} }
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
@@ -1183,6 +1194,10 @@ sub all_ipsets() {
sort keys %ipsets; sort keys %ipsets;
} }
sub compiletime() {
$compiletime;
}
# #
# Create 'currentlineinfo' # Create 'currentlineinfo'
# #
@@ -1256,6 +1271,34 @@ sub shortlineinfo( $ ) {
sub handle_first_entry(); sub handle_first_entry();
#
# Issue a Information Message
#
sub info_message
{
my $currentlineinfo = currentlineinfo;
our @localtime;
handle_first_entry if $first_entry;
$| = 1; #Reset output buffering (flush any partially filled buffers).
if ( $log ) {
@localtime = localtime;
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
}
if ( $confess ) {
print STDERR longmess( " INFO: @_$currentlineinfo" );
print $log longmess( " INFO: @_$currentlineinfo\n" ) if $log;
} else {
print STDERR " INFO: @_$currentlineinfo\n";
print $log " INFO: @_$currentlineinfo\n" if $log;
}
$| = 0; #Re-allow output buffering
}
# #
# Issue a Warning Message # Issue a Warning Message
# #
@@ -1685,7 +1728,7 @@ sub progress_message {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "${leading}${line}\n"; print $log "${leading}${line}\n";
} }
} }
@@ -1704,7 +1747,7 @@ sub progress_message_nocompress {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n"; print $log "@_\n";
} }
} }
@@ -1725,7 +1768,7 @@ sub progress_message2 {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n"; print $log "@_\n";
} }
} }
@@ -1746,7 +1789,7 @@ sub progress_message3 {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n"; print $log "@_\n";
} }
} }
@@ -2515,11 +2558,54 @@ sub directive_error( $$$ ) {
fatal_error $_[0]; fatal_error $_[0];
} }
sub directive_warning( $$$ ) { sub directive_warning( $$$$ ) {
my ( $savefilename, $savelineno ) = ( $currentfilename, $currentlinenumber ); if ( shift ) {
( my $warning, $currentfilename, $currentlinenumber ) = @_; my ( $savefilename, $savelineno ) = ( $currentfilename, $currentlinenumber );
warning_message $warning; ( my $warning, $currentfilename, $currentlinenumber ) = @_;
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno ); warning_message $warning;
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno );
} else {
our @localtime;
handle_first_entry if $first_entry;
$| = 1; #Reset output buffering (flush any partially filled buffers).
if ( $log ) {
@localtime = localtime;
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log " WARNING: $_[0]\n";
}
print STDERR " WARNING: $_[0]\n";
$| = 0; #Re-allow output buffering
}
}
sub directive_info( $$$$ ) {
if ( shift ) {
my ( $savefilename, $savelineno ) = ( $currentfilename, $currentlinenumber );
( my $info, $currentfilename, $currentlinenumber ) = @_;
info_message $info;
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno );
} else {
our @localtime;
handle_first_entry if $first_entry;
$| = 1; #Reset output buffering (flush any partially filled buffers).
if ( $log ) {
@localtime = localtime;
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log " INFO: $_[0]\n";
}
print STDERR " INFO: $_[0]\n";
$| = 0; #Re-allow output buffering
}
} }
# #
@@ -2668,7 +2754,7 @@ sub process_compiler_directive( $$$$ ) {
print "CD===> $line\n" if $debug; print "CD===> $line\n" if $debug;
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+)(.*)$/i; directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+|WARNING\s+|INFO\s+|WARNING!\s+|INFO!\s+)(.*)$/i;
my ($keyword, $expression) = ( uc $1, $2 ); my ($keyword, $expression) = ( uc $1, $2 );
@@ -2776,14 +2862,14 @@ sub process_compiler_directive( $$$$ ) {
delete $actparams{$var} delete $actparams{$var}
} }
} else { } else {
directive_warning( "Shorewall variable $2 does not exist", $filename, $linenumber ); directive_warning( 'Yes', "Shorewall variable $2 does not exist", $filename, $linenumber );
} }
} else { } else {
if ( exists $variables{$2} ) { if ( exists $variables{$2} ) {
delete $variables{$2}; delete $variables{$2};
} else { } else {
directive_warning( "Shell variable $2 does not exist", $filename, $linenumber ); directive_warning( 'Yes', "Shell variable $2 does not exist", $filename, $linenumber );
} }
} }
} }
@@ -2797,7 +2883,7 @@ sub process_compiler_directive( $$$$ ) {
( $comment = $line ) =~ s/^\s*\?COMMENT\s*//; ( $comment = $line ) =~ s/^\s*\?COMMENT\s*//;
$comment =~ s/\s*$//; $comment =~ s/\s*$//;
} else { } else {
directive_warning( "COMMENTs ignored -- require comment support in iptables/Netfilter" , $filename, $linenumber ) unless $warningcount++; directive_warning( 'Yes', "COMMENTs ignored -- require comment support in iptables/Netfilter" , $filename, $linenumber ) unless $warningcount++;
} }
} }
} else { } else {
@@ -2813,7 +2899,48 @@ sub process_compiler_directive( $$$$ ) {
1 ) , 1 ) ,
$filename , $filename ,
$linenumber ) unless $omitting; $linenumber ) unless $omitting;
} } ,
WARNING => sub() {
directive_warning( $config{VERBOSE_MESSAGES} ,
evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ),
$filename ,
$linenumber ) unless $omitting;
} ,
INFO => sub() {
directive_info( $config{VERBOSE_MESSAGES} ,
evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ),
$filename ,
$linenumber ) unless $omitting;
} ,
'WARNING!' => sub() {
directive_warning( ! $config{VERBOSE_MESSAGES} ,
evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ),
$filename ,
$linenumber ) unless $omitting;
} ,
'INFO!' => sub() {
directive_info( ! $config{VERBOSE_MESSAGES} ,
evaluate_expression( $expression ,
$filename ,
$linenumber ,
1 ),
$filename ,
$linenumber ) unless $omitting;
} ,
); );
if ( my $function = $directives{$keyword} ) { if ( my $function = $directives{$keyword} ) {
@@ -3526,7 +3653,7 @@ sub read_a_line($) {
# #
# Handle directives # Handle directives
# #
if ( /^\s*\?(?:IF|ELSE|ELSIF|ENDIF|SET|RESET|FORMAT|COMMENT|ERROR)/i ) { if ( /^\s*\?(?:IF|ELSE|ELSIF|ENDIF|SET|RESET|FORMAT|COMMENT|ERROR|WARNING|INFO)/i ) {
$omitting = process_compiler_directive( $omitting, $_, $currentfilename, $. ); $omitting = process_compiler_directive( $omitting, $_, $currentfilename, $. );
next; next;
} }
@@ -5431,7 +5558,7 @@ sub get_params( $ ) {
# #
delete $params{$_}; delete $params{$_};
} else { } else {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) { unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' ) {
fatal_error "The variable name $_ is reserved and may not be set in the params file" fatal_error "The variable name $_ is reserved and may not be set in the params file"
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_}; if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
} }
@@ -5624,6 +5751,24 @@ sub get_configuration( $$$$ ) {
$ENV{PATH} = $default_path; $ENV{PATH} = $default_path;
} }
fatal_error "Shorewall-core does not appear to be installed" unless open_file "$globals{SHAREDIRPL}coreversion";
fatal_error "$globals{SHAREDIRPL}coreversion is empty" unless read_a_line( PLAIN_READ );
close_file;
warning_message "Version Mismatch: Shorewall-core is version $currentline, while the Shorewall version is $globals{VERSION}" unless $currentline eq $globals{VERSION};
if ( $family == F_IPV6 ) {
open_file( "$globals{SHAREDIR}/version" ) || fatal_error "Unable to open $globals{SHAREDIR}/version";
fatal_error "$globals{SHAREDIR}/version is empty" unless read_a_line( PLAIN_READ );
close_file;
warning_message "Version Mismatch: Shorewall6 is version $currentline, while the Shorewal version is $globals{VERSION}" unless $currentline eq $globals{VERSION};
}
my $have_capabilities; my $have_capabilities;
if ( $export || $> != 0 ) { if ( $export || $> != 0 ) {
@@ -6055,6 +6200,7 @@ sub get_configuration( $$$$ ) {
default_yes_no 'WARNOLDCAPVERSION' , 'Yes'; default_yes_no 'WARNOLDCAPVERSION' , 'Yes';
default_yes_no 'DEFER_DNS_RESOLUTION' , 'Yes'; default_yes_no 'DEFER_DNS_RESOLUTION' , 'Yes';
default_yes_no 'MINIUPNPD' , ''; default_yes_no 'MINIUPNPD' , '';
default_yes_no 'VERBOSE_MESSAGES' , 'Yes';
$config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset'; $config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset';

View File

@@ -302,7 +302,7 @@ sub convert_blacklist() {
if ( @rules ) { if ( @rules ) {
my $fn1 = find_writable_file( 'blrules' ); my $fn1 = find_writable_file( 'blrules' );
my $blrules; my $blrules;
my $date = localtime; my $date = compiletime;
if ( -f $fn1 ) { if ( -f $fn1 ) {
open $blrules, '>>', $fn1 or fatal_error "Unable to open $fn1: $!"; open $blrules, '>>', $fn1 or fatal_error "Unable to open $fn1: $!";
@@ -393,7 +393,7 @@ sub convert_routestopped() {
my ( @allhosts, %source, %dest , %notrack, @rule ); my ( @allhosts, %source, %dest , %notrack, @rule );
my $seq = 0; my $seq = 0;
my $date = localtime; my $date = compiletime;
my ( $stoppedrules, $fn1 ); my ( $stoppedrules, $fn1 );
@@ -421,7 +421,7 @@ EOF
first_entry( first_entry(
sub { sub {
my $date = localtime; my $date = compiletime;
progress_message2 "$doing $fn..."; progress_message2 "$doing $fn...";
print( $stoppedrules print( $stoppedrules
"#\n" , "#\n" ,
@@ -646,11 +646,18 @@ sub create_docker_rules() {
add_commands( $chainref, 'if [ -n "$g_docker" ]; then' ); add_commands( $chainref, 'if [ -n "$g_docker" ]; then' );
incr_cmd_level( $chainref ); incr_cmd_level( $chainref );
add_ijump( $chainref, j => 'DOCKER', o => 'docker0' ); add_ijump( $chainref, j => 'DOCKER', o => 'docker0' );
add_ijump( $chainref, j => 'ACCEPT', o => 'docker0', state_imatch 'ESTABLISHED,RELATED' );
add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => '! docker0' ); add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => '! docker0' );
add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => 'docker0' ) if $dockerref->{options}{routeback}; add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => 'docker0' ) if $dockerref->{options}{routeback};
add_ijump( $filter_table->{OUTPUT}, j => 'DOCKER' );
decr_cmd_level( $chainref ); decr_cmd_level( $chainref );
add_commands( $chainref, 'fi' ); add_commands( $chainref, 'fi' );
my $outputref;
add_commands( $outputref = $filter_table->{OUTPUT}, 'if [ -n "$g_docker" ]; then' );
incr_cmd_level( $outputref );
add_ijump( $outputref, j => 'DOCKER' );
decr_cmd_level( $outputref );
add_commands( $outputref, 'fi' );
} }
add_commands( $chainref, '[ -f ${VARDIR}/.filter_FORWARD ] && cat $VARDIR/.filter_FORWARD >&3', ); add_commands( $chainref, '[ -f ${VARDIR}/.filter_FORWARD ] && cat $VARDIR/.filter_FORWARD >&3', );
@@ -2472,16 +2479,16 @@ EOF
emit <<'EOF'; emit <<'EOF';
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.err "ERROR:$g_product start failed" mylogger kern.err "ERROR:$g_product start failed"
;; ;;
reload) reload)
logger -p kern.err "ERROR:$g_product reload failed" mylogger kern.err "ERROR:$g_product reload failed"
;; ;;
refresh) refresh)
logger -p kern.err "ERROR:$g_product refresh failed" mylogger kern.err "ERROR:$g_product refresh failed"
;; ;;
enable) enable)
logger -p kern.err "ERROR:$g_product 'enable $g_interface' failed" mylogger kern.err "ERROR:$g_product 'enable $g_interface' failed"
;; ;;
esac esac
@@ -2690,7 +2697,7 @@ EOF
emit ' emit '
set_state "Stopped" set_state "Stopped"
logger -p kern.info "$g_product Stopped" mylogger kern.info "$g_product Stopped"
case $COMMAND in case $COMMAND in
stop|clear) stop|clear)

View File

@@ -392,7 +392,7 @@ sub start_provider( $$$$$ ) {
} }
# #
# Look up a provider and return it's number. If unknown provider, 0 is returned # Look up a provider and return a reference to its table entry. If unknown provider, undef is returned
# #
sub lookup_provider( $ ) { sub lookup_provider( $ ) {
my $provider = $_[0]; my $provider = $_[0];
@@ -408,7 +408,7 @@ sub lookup_provider( $ ) {
} }
} }
$providerref ? $providerref->{number} : 0; $providerref;
} }
# #
@@ -666,7 +666,9 @@ sub process_a_provider( $ ) {
if ( $duplicate ne '-' ) { if ( $duplicate ne '-' ) {
fatal_error "The DUPLICATE column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT}; fatal_error "The DUPLICATE column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT};
my $p = lookup_provider( $duplicate ); my $p = lookup_provider( $duplicate );
warning_message "Unknown routing table ($duplicate)" unless $p && ( $p == MAIN_TABLE || $p < BALANCE_TABLE ); my $n = $p ? $p->{number} : 0;
warning_message "Unknown routing table ($duplicate)" unless $n && ( $n == MAIN_TABLE || $n < BALANCE_TABLE );
warning_message "An optional provider ($duplicate) is listed in the DUPLICATE column - enable and disable will not work correctly on that provider" if $p && $p->{optional};
} elsif ( $copy ne '-' ) { } elsif ( $copy ne '-' ) {
fatal_error "The COPY column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT}; fatal_error "The COPY column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT};
fatal_error 'A non-empty COPY column requires that a routing table be specified in the DUPLICATE column' unless $copy eq 'none'; fatal_error 'A non-empty COPY column requires that a routing table be specified in the DUPLICATE column' unless $copy eq 'none';
@@ -1094,7 +1096,7 @@ CEOF
if ( $optional ) { if ( $optional ) {
if ( $persistent ) { if ( $persistent ) {
emit( "persistent_${what}_${table}\n" ); emit( "do_persistent_${what}_${table}\n" );
} }
if ( $shared ) { if ( $shared ) {

View File

@@ -368,7 +368,7 @@ sub setup_conntrack($) {
if ( $convert ) { if ( $convert ) {
my $conntrack; my $conntrack;
my $empty = 1; my $empty = 1;
my $date = localtime; my $date = compiletime;
if ( $fn ) { if ( $fn ) {
open $conntrack, '>>', $fn or fatal_error "Unable to open $fn for notrack conversion: $!"; open $conntrack, '>>', $fn or fatal_error "Unable to open $fn for notrack conversion: $!";

View File

@@ -4464,6 +4464,16 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
}, },
}, },
NFLOG => {
defaultchain => 0,
allowedchains => ALLCHAINS,
minparams => 0,
maxparams => 3,
function => sub () {
$target = validate_level( "NFLOG($params)" );
}
},
RESTORE => { RESTORE => {
defaultchain => 0, defaultchain => 0,
allowedchains => PREROUTING | INPUT | FORWARD | OUTPUT | POSTROUTING, allowedchains => PREROUTING | INPUT | FORWARD | OUTPUT | POSTROUTING,

View File

@@ -674,7 +674,8 @@ sub validate_tc_class( ) {
$markval = numeric_value( $mark ); $markval = numeric_value( $mark );
fatal_error "Invalid MARK ($markval)" unless defined $markval; fatal_error "Invalid MARK ($markval)" unless defined $markval;
fatal_error "Invalid Mark ($mark)" unless $markval <= $globals{TC_MAX}; fatal_error "MARK value too large" unless $markval <= $globals{TC_MAX};
fatal_error "MARK value must be non-zero" unless $markval;
if ( $classnumber ) { if ( $classnumber ) {
fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber}; fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber};
@@ -2165,7 +2166,7 @@ sub convert_tos($$) {
if ( my $fn = open_file 'tos' ) { if ( my $fn = open_file 'tos' ) {
first_entry( first_entry(
sub { sub {
my $date = localtime; my $date = compiletime;
progress_message2 "Converting $fn..."; progress_message2 "Converting $fn...";
print( $mangle print( $mangle
"#\n" , "#\n" ,
@@ -2331,7 +2332,7 @@ sub setup_tc( $ ) {
first_entry( first_entry(
sub { sub {
my $date = localtime; my $date = compiletime;
progress_message2 "Converting $fn..."; progress_message2 "Converting $fn...";
print( $mangle print( $mangle
"#\n" , "#\n" ,

View File

@@ -49,7 +49,7 @@
# generated this program # generated this program
# #
################################################################################ ################################################################################
# Functions imported from /usr/share/shorewall/lib.core # Functions imported from /usr/share/shorewall/lib.runtime
################################################################################ ################################################################################
# Address family-neutral Functions # Address family-neutral Functions
################################################################################ ################################################################################
@@ -1110,7 +1110,7 @@ interface_is_usable() # $1 = interface
# #
find_interface_addresses() # $1 = interface find_interface_addresses() # $1 = interface
{ {
$IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 2' | sed 's/\s*inet6 //;s/\/.*//;s/ peer.*//' $IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 2' | sed 's/\s*inet6 //;s/\/.*//;s/ peer [0-9a-f:]*//'
} }
# #
@@ -1119,7 +1119,7 @@ find_interface_addresses() # $1 = interface
find_interface_full_addresses() # $1 = interface find_interface_full_addresses() # $1 = interface
{ {
$IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 ' | sed 's/\s*inet6 //;s/ scope.*//;s/ peer.*//' $IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 ' | sed 's/\s*inet6 //;s/ scope.*//;s/ peer [0-9a-f:]*//'
} }
# #

View File

@@ -25,6 +25,7 @@ usage() {
echo " savesets <file>" echo " savesets <file>"
echo " call <function> [ <parameter> ... ]" echo " call <function> [ <parameter> ... ]"
echo " version" echo " version"
echo " info"
echo echo
echo "Options are:" echo "Options are:"
echo echo
@@ -469,6 +470,10 @@ case "$COMMAND" in
echo $SHOREWALL_VERSION echo $SHOREWALL_VERSION
status=0 status=0
;; ;;
info)
[ $# -ne 1 ] && usage 2
info_command
;;
help) help)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
usage 0 usage 0

View File

@@ -136,7 +136,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -242,6 +242,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -147,7 +147,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -253,6 +253,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -144,7 +144,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -250,6 +250,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -147,7 +147,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -253,6 +253,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -242,6 +242,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -514,7 +514,7 @@ echo "Default config path file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/confi
# Install the Standard Actions file # Install the Standard Actions file
# #
install_file actions.std ${DESTDIR}${SHAREDIR}/$PRODUCT/actions.std 0644 install_file actions.std ${DESTDIR}${SHAREDIR}/$PRODUCT/actions.std 0644
echo "Standard actions file installed as ${DESTDIR}${SHAREDIR}d/$PRODUCT/actions.std" echo "Standard actions file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/actions.std"
cd configfiles cd configfiles
@@ -1063,9 +1063,9 @@ fi
# #
for f in action.* ; do for f in action.* ; do
case $f in case $f in
action.A_Reject) *.deprecated)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/$f 0644 install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*} 0644
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/$f" echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*}"
;; ;;
*) *)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644 install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
@@ -1078,9 +1078,9 @@ cd Macros
for f in macro.* ; do for f in macro.* ; do
case $f in case $f in
macro.SNMPTrap) *.deprecated)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/$f 0644 install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*} 0644
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/$f" echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*}"
;; ;;
*) *)
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644 install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
@@ -1177,6 +1177,8 @@ fi
# Install the Man Pages # Install the Man Pages
# #
if [ -n "$MANDIR" ]; then
cd manpages cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/ [ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
@@ -1196,6 +1198,7 @@ done
cd .. cd ..
echo "Man Pages Installed" echo "Man Pages Installed"
fi
if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT

View File

@@ -435,7 +435,7 @@ compiler() {
get_config Yes get_config Yes
case $COMMAND in case $COMMAND in
*start|try|refresh) *start|try|refresh|reload|restart|safe-*)
;; ;;
*) *)
STARTUP_LOG= STARTUP_LOG=
@@ -493,13 +493,13 @@ compiler() {
case "$g_doing" in case "$g_doing" in
Compiling|Checking) Compiling|Checking)
progress_message3 "$g_doing using $g_product $SHOREWALL_VERSION..." progress_message3 "$g_doing using Shorewall $SHOREWALL_VERSION..."
;; ;;
Updating) Updating)
progress_message3 "Updating $g_product configuration to $SHOREWALL_VERSION..." progress_message3 "Updating $g_product configuration to $SHOREWALL_VERSION..."
;; ;;
*) *)
[ -n "$g_doing" ] && progress_message3 "$g_doing using $g_product $SHOREWALL_VERSION..." [ -n "$g_doing" ] && progress_message3 "$g_doing using Shorewall $SHOREWALL_VERSION..."
;; ;;
esac esac
# #
@@ -548,7 +548,7 @@ start_command() {
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
rc=$? rc=$?
logger -p kern.err "ERROR:$g_product start failed" mylogger kern.err "ERROR:$g_product start failed"
fi fi
fi fi
@@ -604,7 +604,7 @@ start_command() {
option=${option#C} option=${option#C}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -620,7 +620,8 @@ start_command() {
0) 0)
;; ;;
1) 1)
[ -n "$g_shorewalldir" -o -n "$g_fast" ] && usage 2 [ -n "$g_shorewalldir" ] && fatal_error "A directory has already been specified: $1"
[ -n "$g_fast" ] && fatal_error "Directory may not be specified with the -f option"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -634,7 +635,7 @@ start_command() {
AUTOMAKE= AUTOMAKE=
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -663,8 +664,6 @@ compile_command() {
shift shift
option=${option#-} option=${option#-}
[ -z "$option" ] && usage 1
while [ -n "$option" ]; do while [ -n "$option" ]; do
case $option in case $option in
e*) e*)
@@ -701,7 +700,7 @@ compile_command() {
option= option=
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -723,7 +722,7 @@ compile_command() {
[ -d "$g_file" ] && fatal_error "$g_file is a directory" [ -d "$g_file" ] && fatal_error "$g_file is a directory"
;; ;;
2) 2)
[ -n "$g_shorewalldir" -a -z "$g_export" ] && usage 2 [ -n "$g_shorewalldir" -a -z "$g_export" ] && fatal_error "A directory has already been specified: $1"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -737,7 +736,7 @@ compile_command() {
g_file=$2 g_file=$2
;; ;;
*) *)
usage 1 too_many_arguments $3
;; ;;
esac esac
@@ -791,7 +790,7 @@ check_command() {
option=${option#i} option=${option#i}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -807,7 +806,7 @@ check_command() {
0) 0)
;; ;;
1) 1)
[ -n "$g_shorewalldir" -a -z "$g_export" ] && usage 2 [ -n "$g_shorewalldir" -a -z "$g_export" ] && fatal_error "A directory has already been specified: $1"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -820,7 +819,7 @@ check_command() {
g_shorewalldir=$(resolve_file $1) g_shorewalldir=$(resolve_file $1)
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -883,7 +882,7 @@ update_command() {
option=${option#A} option=${option#A}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -899,7 +898,7 @@ update_command() {
0) 0)
;; ;;
1) 1)
[ -n "$g_shorewalldir" ] && usage 2 [ -n "$g_shorewalldir" ] && fatal_error "A directory has already been specified: $1"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -912,7 +911,7 @@ update_command() {
g_shorewalldir=$(resolve_file $1) g_shorewalldir=$(resolve_file $1)
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -977,7 +976,7 @@ restart_command() {
option=${option#C} option=${option#C}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -993,7 +992,7 @@ restart_command() {
0) 0)
;; ;;
1) 1)
[ -n "$g_shorewalldir" ] && usage 2 [ -n "$g_shorewalldir" ] && fatal_error "A directory has already been specified: $1"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -1008,7 +1007,7 @@ restart_command() {
AUTOMAKE= AUTOMAKE=
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -1028,7 +1027,7 @@ restart_command() {
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
rc=$? rc=$?
logger -p kern.err "ERROR:$g_product ${COMMAND} failed" mylogger kern.err "ERROR:$g_product ${COMMAND} failed"
fi fi
else else
[ -x ${VARDIR}/firewall ] || fatal_error "No ${VARDIR}/firewall file found" [ -x ${VARDIR}/firewall ] || fatal_error "No ${VARDIR}/firewall file found"
@@ -1086,7 +1085,7 @@ refresh_command() {
fi fi
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -1169,7 +1168,7 @@ safe_commands() {
shift; shift;
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -1185,7 +1184,7 @@ safe_commands() {
0) 0)
;; ;;
1) 1)
[ -n "$g_shorewalldir" ] && usage 2 [ -n "$g_shorewalldir" ] && fatal_error "A directory has already been specified: $1"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -1198,7 +1197,7 @@ safe_commands() {
g_shorewalldir=$(resolve_file $1) g_shorewalldir=$(resolve_file $1)
;; ;;
*) *)
usage 1 too_many_arguments $2
;; ;;
esac esac
@@ -1286,7 +1285,7 @@ try_command() {
timeout= timeout=
handle_directory() { handle_directory() {
[ -n "$g_shorewalldir" ] && usage 2 [ -n "$g_shorewalldir" ] && fatal_error "A directory has already been specified: $1"
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
if [ -e $1 ]; then if [ -e $1 ]; then
@@ -1316,7 +1315,7 @@ try_command() {
option=${option#n} option=${option#n}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -1330,7 +1329,7 @@ try_command() {
case $# in case $# in
0) 0)
usage 1 missing_argument
;; ;;
1) 1)
handle_directory $1 handle_directory $1
@@ -1341,7 +1340,7 @@ try_command() {
timeout=$2 timeout=$2
;; ;;
*) *)
usage 1 too_many_arguments $3
;; ;;
esac esac
@@ -1480,7 +1479,7 @@ remote_reload_command() # $* = original arguments less the command.
option=${option#i} option=${option#i}
;; ;;
*) *)
usage 1 option_error $option
;; ;;
esac esac
done done
@@ -1493,6 +1492,9 @@ remote_reload_command() # $* = original arguments less the command.
done done
case $# in case $# in
0)
missing_argument
;;
1) 1)
g_shorewalldir="." g_shorewalldir="."
system=$1 system=$1
@@ -1502,7 +1504,7 @@ remote_reload_command() # $* = original arguments less the command.
system=$2 system=$2
;; ;;
*) *)
usage 1 too_many_arguments $3
;; ;;
esac esac
@@ -1742,7 +1744,7 @@ compiler_command() {
safe_commands $@ safe_commands $@
;; ;;
*) *)
usage 1 fatal_error "Invalid command: $COMMAND"
;; ;;
esac esac

View File

@@ -504,7 +504,7 @@ INLINE eth0 - ; -p tcp -j MARK --set
<member>0xc0a80403 LAND 0xFF = 0x03</member> <member>0xc0a80403 LAND 0xFF = 0x03</member>
<member>0x03 LOR 0x0x10100 = 0x10103 or class ID <member>0x03 LOR 0x10100 = 0x10103 or class ID
1:103</member> 1:103</member>
</simplelist> </simplelist>
</blockquote> </blockquote>
@@ -598,6 +598,36 @@ INLINE eth0 - ; -p tcp -j MARK --set
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis
role="bold">NFLOG</emphasis>[(<emphasis>nflog-parameters</emphasis>)]</term>
<listitem>
<para>Added in Shorewall 5.0.9. Logs matching packets using
NFLOG. The <replaceable>nflog-parameters</replaceable> are a
comma-separated list of up to 3 numbers:</para>
<itemizedlist>
<listitem>
<para>The first number specifies the netlink group
(0-65535). If omitted (e.g., NFLOG(,0,10)) then a value of
0 is assumed.</para>
</listitem>
<listitem>
<para>The second number specifies the maximum number of
bytes to copy. If omitted, 0 (no limit) is assumed.</para>
</listitem>
<listitem>
<para>The third number specifies the number of log
messages that should be buffered in the kernel before they
are sent to user space. The default is 1.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><emphasis <term><emphasis
role="bold">RESTORE</emphasis>[(<emphasis>mask</emphasis>)]</term> role="bold">RESTORE</emphasis>[(<emphasis>mask</emphasis>)]</term>

View File

@@ -595,9 +595,32 @@
<para>Added in Shorewall 4.5.9.3. Queues matching packets to a <para>Added in Shorewall 4.5.9.3. Queues matching packets to a
back end logging daemon via a netlink socket then continues to back end logging daemon via a netlink socket then continues to
the next rule. See <ulink the next rule. See <ulink
url="/shorewall.logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para> url="/shorewall.logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.
</para>
<para>Similar to<emphasis role="bold"> <para>The <replaceable>nflog-parameters</replaceable> are a
comma-separated list of up to 3 numbers:</para>
<itemizedlist>
<listitem>
<para>The first number specifies the netlink group
(0-65535). If omitted (e.g., NFLOG(,0,10)) then a value of
0 is assumed.</para>
</listitem>
<listitem>
<para>The second number specifies the maximum number of
bytes to copy. If omitted, 0 (no limit) is assumed.</para>
</listitem>
<listitem>
<para>The third number specifies the number of log
messages that should be buffered in the kernel before they
are sent to user space. The default is 1.</para>
</listitem>
</itemizedlist>
<para>NFLOG is similar to<emphasis role="bold">
LOG:NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)], LOG:NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)],
except that the log level is not changed when this ACTION is except that the log level is not changed when this ACTION is
used in an action or macro body and the invocation of that used in an action or macro body and the invocation of that

View File

@@ -156,20 +156,23 @@
<varlistentry> <varlistentry>
<term><emphasis role="bold">MARK</emphasis> - <term><emphasis role="bold">MARK</emphasis> -
{-|<emphasis>value</emphasis>}</term> {-|<replaceable>value</replaceable>[:<replaceable>priority</replaceable>]}</term>
<listitem> <listitem>
<para>The mark <emphasis>value</emphasis> which is an integer in the <para>The mark <emphasis>value</emphasis> which is an integer in the
range 1-255. You set mark values in the <ulink range 1-255. You set mark values in the <ulink
url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5) url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5)
file, marking the traffic you want to fit in the classes defined in file, marking the traffic you want to fit in the classes defined in
here. Must be specified as '-' if the <emphasis here. You can use the same marks for different interfaces.</para>
role="bold">classify</emphasis> option is given for the interface in
<ulink
url="/manpages/shorewall-tcdevices.html">shorewall-tcdevices</ulink>(5)
and you are running Shorewall 4.5.5 or earlier.</para>
<para>You can use the same marks for different interfaces.</para> <para>The <replaceable>priority</replaceable>, if specified, is an
integer in the range 1-65535 and determines the relative order in
which the tc mark classification filter for this class is to be
applied to packets being sent on the
<replaceable>interface</replaceable>. Filters are applied in
ascending numerical order. If not supplied, the value is derived
from the class priority (PRIORITY column value below):
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 20.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -293,7 +296,7 @@
<para>This is the default class for that interface where all <para>This is the default class for that interface where all
traffic should go, that is not classified otherwise.</para> traffic should go, that is not classified otherwise.</para>
<para></para> <para/>
<note> <note>
<para>You must define <emphasis <para>You must define <emphasis
@@ -320,7 +323,7 @@
priority determines the order in which filter rules are priority determines the order in which filter rules are
processed during packet classification. If not specified, the processed during packet classification. If not specified, the
value (<replaceable>class priority</replaceable> &lt;&lt; 8) | value (<replaceable>class priority</replaceable> &lt;&lt; 8) |
10) is used.</para> 15) is used.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -339,7 +342,7 @@
(":") and a <replaceable>priority</replaceable>. This priority (":") and a <replaceable>priority</replaceable>. This priority
determines the order in which filter rules are processed determines the order in which filter rules are processed
during packet classification. If not specified, the value during packet classification. If not specified, the value
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 10) (<replaceable>class priority</replaceable> &lt;&lt; 8) | 15)
is used.</para> is used.</para>
<programlisting> <emphasis role="bold">tos-minimize-delay</emphasis> 0x10/0x10 <programlisting> <emphasis role="bold">tos-minimize-delay</emphasis> 0x10/0x10
@@ -372,7 +375,7 @@
(":") and a <replaceable>priority</replaceable>. This priority (":") and a <replaceable>priority</replaceable>. This priority
determines the order in which filter rules are processed determines the order in which filter rules are processed
during packet classification. If not specified, the value during packet classification. If not specified, the value
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 20) (<replaceable>class priority</replaceable> &lt;&lt; 8) | 10)
is used.</para> is used.</para>
<note> <note>

View File

@@ -2504,8 +2504,10 @@ INLINE - - - ; -j REJECT
<para>If specified, determines where Shorewall will log the details <para>If specified, determines where Shorewall will log the details
of each <emphasis role="bold">start</emphasis>, <emphasis of each <emphasis role="bold">start</emphasis>, <emphasis
role="bold">reload</emphasis>, <emphasis role="bold">reload</emphasis>, <emphasis
role="bold">restart</emphasis> and <emphasis role="bold">restart</emphasis>, <emphasis
role="bold">refresh</emphasis> command. Logging verbosity is role="bold">refresh</emphasis>, <emphasis
role="bold">try</emphasis>, and <emphasis
role="bold">safe-</emphasis>* command. Logging verbosity is
determined by the setting of LOG_VERBOSITY above.</para> determined by the setting of LOG_VERBOSITY above.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -2862,6 +2864,20 @@ INLINE - - - ; -j REJECT
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis role="bold">VERBOSE_MESSAGES=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>Added in Shorewall 5.0.9. When Yes (the default), messages
produced by the ?INFO and ?WARNING directives include the filename
and linenumber of the directive. When set to No, that additional
information is omitted. The setting may be overridden on a directive
by directive basis by following ?INFO or ?WARNING with '!' (no
intervening white space).</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><emphasis <term><emphasis
role="bold">VERBOSITY=</emphasis>[<emphasis>number</emphasis>]</term> role="bold">VERBOSITY=</emphasis>[<emphasis>number</emphasis>]</term>

View File

@@ -2625,6 +2625,34 @@
started.</para> started.</para>
</refsect1> </refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by Shorewall:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1> <refsect1>
<title>FILES</title> <title>FILES</title>

View File

@@ -215,7 +215,7 @@ rm -rf ${SHAREDIR}/shorewall/configfiles/
rm -rf ${SHAREDIR}/shorewall/Samples/ rm -rf ${SHAREDIR}/shorewall/Samples/
rm -rf ${SHAREDIR}/shorewall/Shorewall/ rm -rf ${SHAREDIR}/shorewall/Shorewall/
rm -f ${SHAREDIR}/shorewall/lib.cli-std rm -f ${SHAREDIR}/shorewall/lib.cli-std
rm -f ${SHAREDIR}/shorewall/lib.core rm -f ${SHAREDIR}/shorewall/lib.runtime
rm -f ${SHAREDIR}/shorewall/compiler.pl rm -f ${SHAREDIR}/shorewall/compiler.pl
rm -f ${SHAREDIR}/shorewall/prog.* rm -f ${SHAREDIR}/shorewall/prog.*
rm -f ${SHAREDIR}/shorewall/module* rm -f ${SHAREDIR}/shorewall/module*

View File

@@ -1547,6 +1547,35 @@
started.</para> started.</para>
</refsect1> </refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by
Shorewall6-lite:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1> <refsect1>
<title>See ALSO</title> <title>See ALSO</title>

View File

@@ -129,7 +129,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -213,6 +213,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -130,7 +130,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -214,6 +214,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -129,7 +129,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -213,6 +213,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -129,7 +129,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes AUTOHELPERS=Yes
AUTOMAKE=No AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED" BLACKLIST="NEW,INVALID,UNTRACKED"
@@ -213,6 +213,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -213,6 +213,8 @@ USE_PHYSICAL_NAMES=No
USE_RT_NAMES=No USE_RT_NAMES=No
VERBOSE_MESSAGES=Yes
WARNOLDCAPVERSION=Yes WARNOLDCAPVERSION=Yes
WORKAROUNDS=No WORKAROUNDS=No

View File

@@ -515,7 +515,7 @@ INLINE eth0 - ; -p tcp -j MARK --set
<member>0xc0a80403 LAND 0xFF = 0x03</member> <member>0xc0a80403 LAND 0xFF = 0x03</member>
<member>0x03 LOR 0x0x10100 = 0x10103 or class ID <member>0x03 LOR 0x10100 = 0x10103 or class ID
1:103</member> 1:103</member>
</simplelist> </simplelist>
</blockquote> </blockquote>
@@ -609,6 +609,36 @@ INLINE eth0 - ; -p tcp -j MARK --set
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis
role="bold">NFLOG</emphasis>[(<emphasis>nflog-parameters</emphasis>)]</term>
<listitem>
<para>Added in Shorewall 5.0.9. Logs matching packets using
NFLOG. The <replaceable>nflog-parameters</replaceable> are a
comma-separated list of up to 3 numbers:</para>
<itemizedlist>
<listitem>
<para>The first number specifies the netlink group
(0-65535). If omitted (e.g., NFLOG(,0,10)) then a value of
0 is assumed.</para>
</listitem>
<listitem>
<para>The second number specifies the maximum number of
bytes to copy. If omitted, 0 (no limit) is assumed.</para>
</listitem>
<listitem>
<para>The third number specifies the number of log
messages that should be buffered in the kernel before they
are sent to user space. The default is 1. </para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><emphasis <term><emphasis
role="bold">RESTORE</emphasis>[(<emphasis>mask</emphasis>)]</term> role="bold">RESTORE</emphasis>[(<emphasis>mask</emphasis>)]</term>

View File

@@ -574,7 +574,29 @@
the next rule. See <ulink the next rule. See <ulink
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para> url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
<para>Similar to<emphasis role="bold"> <para>The <replaceable>nflog-parameters</replaceable> are a
comma-separated list of up to 3 numbers:</para>
<itemizedlist>
<listitem>
<para>The first number specifies the netlink group
(0-65535). If omitted (e.g., NFLOG(,0,10)) then a value of
0 is assumed.</para>
</listitem>
<listitem>
<para>The second number specifies the maximum number of
bytes to copy. If omitted, 0 (no limit) is assumed.</para>
</listitem>
<listitem>
<para>The third number specifies the number of log
messages that should be buffered in the kernel before they
are sent to user space. The default is 1.</para>
</listitem>
</itemizedlist>
<para>NFLOG is similar to<emphasis role="bold">
LOG:NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)], LOG:NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)],
except that the log level is not changed when this ACTION is except that the log level is not changed when this ACTION is
used in an action or macro and the invocation of that action used in an action or macro and the invocation of that action
@@ -1636,7 +1658,7 @@
<varlistentry> <varlistentry>
<term><emphasis role="bold">route</emphasis>, <emphasis <term><emphasis role="bold">route</emphasis>, <emphasis
role="bold">ipv6-route</emphasis> or <emphasis role="bold">ipv6-route</emphasis> or <emphasis
role="bold">41</emphasis></term> role="bold">43</emphasis></term>
<listitem> <listitem>
<para>IPv6 Route extension header.</para> <para>IPv6 Route extension header.</para>

View File

@@ -152,20 +152,23 @@
<varlistentry> <varlistentry>
<term><emphasis role="bold">MARK</emphasis> - <term><emphasis role="bold">MARK</emphasis> -
{-|<emphasis>value</emphasis>}</term> {-|<replaceable>value</replaceable>[:<replaceable>priority</replaceable>]}</term>
<listitem> <listitem>
<para>The mark <emphasis>value</emphasis> which is an integer in the <para>The mark <emphasis>value</emphasis> which is an integer in the
range 1-255. You set mark values in the <ulink range 1-255. You set mark values in the <ulink
url="/manpages6/shorewall6-mangle.html">shorewall6-mangle</ulink>(5) url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5)
file, marking the traffic you want to fit in the classes defined in file, marking the traffic you want to fit in the classes defined in
here. Must be specified as '-' if the <emphasis here. You can use the same marks for different interfaces.</para>
role="bold">classify</emphasis> option is given for the interface in
<ulink
url="/manpages6/shorewall6-tcdevices.html">shorewall6-tcdevices</ulink>(5)
and you are running Shorewall 4.5 5 or earlier.</para>
<para>You can use the same marks for different interfaces.</para> <para>The <replaceable>priority</replaceable>, if specified, is an
integer in the range 1-65535 and determines the relative order in
which the tc mark classification filter for this class is to be
applied to packets being sent on the
<replaceable>interface</replaceable>. Filters are applied in
ascending numerical order. If not supplied, the value is derived
from the class priority (PRIORITY column value below):
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 20.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -314,7 +317,7 @@
priority determines the order in which filter rules are priority determines the order in which filter rules are
processed during packet classification. If not specified, the processed during packet classification. If not specified, the
value (<replaceable>class priority</replaceable> &lt;&lt; 8) | value (<replaceable>class priority</replaceable> &lt;&lt; 8) |
10) is used.</para> 15) is used.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -366,7 +369,7 @@
(":") and a <replaceable>priority</replaceable>. This priority (":") and a <replaceable>priority</replaceable>. This priority
determines the order in which filter rules are processed determines the order in which filter rules are processed
during packet classification. If not specified, the value during packet classification. If not specified, the value
(<replaceable>class priority</replaceable> &lt;&lt; 8) | 20) (<replaceable>class priority</replaceable> &lt;&lt; 8) | 10)
is used.</para> is used.</para>
<note> <note>

View File

@@ -2139,11 +2139,13 @@ INLINE - - - ; -j REJECT
role="bold">STARTUP_LOG=</emphasis>[<emphasis>pathname</emphasis>]</term> role="bold">STARTUP_LOG=</emphasis>[<emphasis>pathname</emphasis>]</term>
<listitem> <listitem>
<para>If specified, determines where Shorewall6 will log the details <para>If specified, determines where Shorewall will log the details
of each <emphasis role="bold">start</emphasis>, <emphasis of each <emphasis role="bold">start</emphasis>, <emphasis
role="bold">reload</emphasis>, <emphasis role="bold">reload</emphasis>, <emphasis
role="bold">restart</emphasis> and <emphasis role="bold">restart</emphasis>, <emphasis
role="bold">refresh</emphasis> command. Logging verbosity is role="bold">refresh</emphasis>, <emphasis
role="bold">try</emphasis>, and <emphasis
role="bold">safe-</emphasis>* command. Logging verbosity is
determined by the setting of LOG_VERBOSITY above.</para> determined by the setting of LOG_VERBOSITY above.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -2504,6 +2506,20 @@ INLINE - - - ; -j REJECT
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis role="bold">VERBOSE_MESSAGES=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>Added in Shorewall 5.0.9. When Yes (the default), messages
produced by the ?INFO and ?WARNING directives include the filename
and linenumber of the directive. When set to No, that additional
information is omitted. The setting may be overridden on a directive
by directive basis by following ?INFO or ?WARNING with '!' (no
intervening white space).</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><emphasis <term><emphasis
role="bold">VERBOSITY=</emphasis>[<emphasis>number</emphasis>]</term> role="bold">VERBOSITY=</emphasis>[<emphasis>number</emphasis>]</term>

View File

@@ -2501,6 +2501,34 @@
started.</para> started.</para>
</refsect1> </refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>Two environmental variables are recognized by Shorewall6:</para>
<variablelist>
<varlistentry>
<term>SHOREWALL_INIT_SCRIPT</term>
<listitem>
<para>When set to 1, causes Std out to be redirected to the file
specified in the STARTUP_LOG option in <ulink
url="shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SW_LOGGERTAG</term>
<listitem>
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
value is passed to the logger utility in its -t (--tag)
option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1> <refsect1>
<title>See ALSO</title> <title>See ALSO</title>

View File

@@ -74,7 +74,7 @@
<section> <section>
<title>Documentation for Earlier Versions</title> <title>Documentation for Earlier Versions</title>
<para><ulink url="4.2/Documentation_Index.html">Shorewall 4.4/4.6 <para><ulink url="4.6/Documentation_Index.html">Shorewall 4.4/4.6
Documentation</ulink></para> Documentation</ulink></para>
<para><ulink url="4.2/Documentation_Index.html">Shorewall 4.0/4.2 <para><ulink url="4.2/Documentation_Index.html">Shorewall 4.0/4.2

View File

@@ -95,6 +95,11 @@ rsyncok eth1:<emphasis role="bold">dynamic</emphasis></programlisting>
<para>When the <emphasis role="bold">dynamic_shared</emphasis> option is <para>When the <emphasis role="bold">dynamic_shared</emphasis> option is
specified, a single ipset is created; the ipset has the same name as the specified, a single ipset is created; the ipset has the same name as the
zone.</para> zone.</para>
<para>In the above example, <emphasis role="bold">rsyncok</emphasis> is
a sub-zone of the single zone <emphasis role="bold">loc</emphasis>.
Making a dynamic zone a sub-zone of multiple other zones is also
supported.</para>
</section> </section>
<section id="Adding"> <section id="Adding">

View File

@@ -204,7 +204,7 @@
<para>If the <replaceable>action</replaceable> involves logging, <para>If the <replaceable>action</replaceable> involves logging,
then this parameter specifies the disposition that will appear in then this parameter specifies the disposition that will appear in
the log entry prefix. If no <replaceable>disposition</replaceable> the log entry prefix. If no <replaceable>disposition</replaceable>
is given, the log prefix is determines normally. The default is is given, the log prefix is determined normally. The default is
ACCEPT.</para> ACCEPT.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -258,7 +258,7 @@
<para>If the <replaceable>action</replaceable> involves logging, <para>If the <replaceable>action</replaceable> involves logging,
then this parameter specifies the disposition that will appear in then this parameter specifies the disposition that will appear in
the log entry prefix. If no <replaceable>disposition</replaceable> the log entry prefix. If no <replaceable>disposition</replaceable>
is given, the log prefix is determines normally.</para> is given, the log prefix is determined normally.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
@@ -404,7 +404,7 @@
<para>If the <replaceable>action</replaceable> involves logging, <para>If the <replaceable>action</replaceable> involves logging,
then this parameter specifies the disposition that will appear in then this parameter specifies the disposition that will appear in
the log entry prefix. If no <replaceable>disposition</replaceable> the log entry prefix. If no <replaceable>disposition</replaceable>
is given, the log prefix is determines normally.</para> is given, the log prefix is determined normally.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>

View File

@@ -301,8 +301,8 @@
<para>COMMENT, FORMAT and SECTION Lines now require the leading question <para>COMMENT, FORMAT and SECTION Lines now require the leading question
mark ("?"). In earlier releases, the question mark was optional. The mark ("?"). In earlier releases, the question mark was optional. The
<command>shorewall[6] update -D</command> command will insert the <command>shorewall[6] update -D</command> command in Shorewall 4.6 will
question marks for you.</para> insert the question marks for you.</para>
</section> </section>
</section> </section>
@@ -359,7 +359,7 @@
<para>It is strongly recommended that you first upgrade your installation <para>It is strongly recommended that you first upgrade your installation
to a 4.6 release that supports the <option>-A</option> option to the to a 4.6 release that supports the <option>-A</option> option to the
<command>update</command> command; 4.6.13 is preferred.</para> <command>update</command> command; 4.6.13.2 or later is preferred.</para>
<para>Once you are on that release, execute the <command>shorewall update <para>Once you are on that release, execute the <command>shorewall update
-A</command> command (and <command>shorewall6 update -A</command> if you -A</command> command (and <command>shorewall6 update -A</command> if you
@@ -374,11 +374,11 @@
likely won't start or work correctly until you do.</para> likely won't start or work correctly until you do.</para>
<para>The <command>update</command> command in Shorewall 5 has many fewer <para>The <command>update</command> command in Shorewall 5 has many fewer
options. The <option>-b</option>, <option>-t</option>, <option>-n</option> options. The <option>-b</option>, <option>-t</option>,
and <option>-s </option>options have been removed -- the updates triggered <option>-n</option>, <option>-D</option> and <option>-s </option>options
by those options are now performed unconditionally. The <option>-i have been removed -- the updates triggered by those options are now
</option>and <option>-A </option>options have been retained - both enable performed unconditionally. The <option>-i </option>and <option>-A
checking for issues that could result if INLINE_MATCHES were to be set to </option>options have been retained - both enable checking for issues that
Yes.</para> could result if INLINE_MATCHES were to be set to Yes.</para>
</section> </section>
</article> </article>

View File

@@ -2223,6 +2223,20 @@ SSH(ACCEPT) net:$MYIP $FW
<programlisting> ERROR: Invalid value for Bricks (2000) /usr/share/shorewall/action.GlusterFS (line 15) <programlisting> ERROR: Invalid value for Bricks (2000) /usr/share/shorewall/action.GlusterFS (line 15)
from /etc/shorewall/rules (line 45)</programlisting> from /etc/shorewall/rules (line 45)</programlisting>
<para>In Shorewall 5.0.8, ?WARNING and ?INFO directives were added.</para>
<programlisting>?WARNING <replaceable>message</replaceable>
?INFO <replaceable>message</replaceable></programlisting>
<para>?WARNING message produces a standard Shorewall WARNING: message,
while ?INFO produces a similar message which is prefaced by INFO: rather
than WARNING:. Both write the message to STDERR. The message is also
written to the STARTUP_LOG, if any, provided that the command is
<command>start</command>, <command>try</command>,
<command>restart</command>, <command>reload</command>,
<command>refresh</command>, or one of the <command>safe</command>-*
commands.</para>
</section> </section>
<section id="Embedded"> <section id="Embedded">

View File

@@ -293,7 +293,7 @@ gateway:/etc/shorewall# </programl
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>The first number specifies the netlink group (0-32). If <para>The first number specifies the netlink group (0-65535). If
omitted (e.g., NFLOG(,0,10)) then a value of 0 is assumed.</para> omitted (e.g., NFLOG(,0,10)) then a value of 0 is assumed.</para>
</listitem> </listitem>