mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-16 17:51:16 +01:00
Ignore leading white space on certain continuation lines
Signed-off-by: Tom Eastep <teastep@shorewall.net> git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9740 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
d67c94de9c
commit
b663644d0d
@ -1504,6 +1504,10 @@ sub read_a_line() {
|
||||
|
||||
chomp;
|
||||
#
|
||||
# Suppress leading whitespace in certain continuation lines
|
||||
#
|
||||
s/^\s*// if $currentline =~ /[,:]$/;
|
||||
#
|
||||
# Continuation
|
||||
#
|
||||
chop $currentline, next if substr( ( $currentline .= $_ ), -1, 1 ) eq '\\';
|
||||
|
@ -8,6 +8,8 @@ Changes in Shorewall 4.3.8
|
||||
|
||||
4) Detect gateway via dhclient leases file.
|
||||
|
||||
5) Suppress leading whitespace on certain continuation lines.
|
||||
|
||||
Changes in Shorewall 4.3.7
|
||||
|
||||
1) Fix forward treatment of interface options.
|
||||
|
@ -65,6 +65,24 @@ None.
|
||||
the dhclient lease file for the interface
|
||||
(/var/run/dhcp/dhclient-<if>.lease).
|
||||
|
||||
3) To improve readability of the configuration files, Shorewall now
|
||||
allows leading white space in continuation lines when the continued
|
||||
line ends in ":" or ",".
|
||||
|
||||
Example (/etc/shorewall/rules):
|
||||
|
||||
#ACTION SOURCE DEST PROTO DEST
|
||||
# PORT(S)
|
||||
ACCEPT net:\
|
||||
206.124.146.177,\
|
||||
206.124.146.178,\
|
||||
206.124.146.180\
|
||||
dmz tcp 873
|
||||
|
||||
The leading white space on the lines that contain just an IP
|
||||
address is ignored so the SOURCE column effectively contains
|
||||
"net:206.124.146.177,206.124.147.178,206.124.146.180".
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
N E W F E A T U R E S IN 4 . 3
|
||||
----------------------------------------------------------------------------
|
||||
|
@ -400,6 +400,35 @@ br0 - routeback</programlisting></para>
|
||||
|
||||
<programlisting>ACCEPT net $FW tcp \↵
|
||||
smtp,www,pop3,imap #Services running on the firewall</programlisting>
|
||||
|
||||
<para>In certain cases, leading white space is ignored in continuation
|
||||
lines:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>The continued line ends with a colon (":")</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>The continued line ends with a comma (",")</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>Example (<filename>/etc/shorewall/rules</filename>):</para>
|
||||
|
||||
<programlisting>#ACTION SOURCE DEST PROTO DEST
|
||||
# PORT(S)
|
||||
ACCEPT net:\
|
||||
206.124.146.177,\
|
||||
206.124.146.178,\
|
||||
206.124.146.180\
|
||||
dmz tcp 873</programlisting>
|
||||
|
||||
<para> The leading white space on the first through third continuation
|
||||
lines is ignored so the SOURCE column effectively contains
|
||||
"net:206.124.146.177,206.124.147.178,206.124.146.180". Because the third
|
||||
continuation line does not end with a comma or colon, the leading white
|
||||
space in the last line is not ignored.</para>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user