forked from extern/shorewall_code
Also substitute the chain name for '@0' in SWITCH names.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
172c1a5b44
commit
15121e0743
@ -4654,9 +4654,10 @@ sub do_condition( $$ ) {
|
|||||||
|
|
||||||
require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's';
|
require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's';
|
||||||
|
|
||||||
if ( $condition =~ /\@\{0\}/ ) {
|
|
||||||
$chain =~ s/[^\w-]//g;
|
$chain =~ s/[^\w-]//g;
|
||||||
$condition =~ s/\@\{0\}/$chain/g;
|
# $1 $2 - $3
|
||||||
|
while ( $condition =~ m( ^(.*?) @({)?0(?(2)}) (.*)$ )x ) {
|
||||||
|
$condition = join( '', $1, $chain, $3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/ && length $condition <= 30;
|
fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/ && length $condition <= 30;
|
||||||
|
@ -399,12 +399,12 @@
|
|||||||
'!' is supplied, the test is inverted such that the rule is enabled
|
'!' is supplied, the test is inverted such that the rule is enabled
|
||||||
if the file contains 0.</para>
|
if the file contains 0.</para>
|
||||||
|
|
||||||
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
|
<para>Within the <replaceable>switch-name</replaceable>, '@0' and
|
||||||
replaced by the name of the chain to which the rule is a added. The
|
'@{0}' are replaced by the name of the chain to which the rule is a
|
||||||
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
|
added. The <replaceable>switch-name</replaceable> (after '...'
|
||||||
begin with a letter and be composed of letters, decimal digits,
|
expansion) must begin with a letter and be composed of letters,
|
||||||
underscores or hyphens. Switch names must be 30 characters or less
|
decimal digits, underscores or hyphens. Switch names must be 30
|
||||||
in length.</para>
|
characters or less in length.</para>
|
||||||
|
|
||||||
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
||||||
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
||||||
@ -426,8 +426,9 @@
|
|||||||
|
|
||||||
<para>When the <replaceable>switch-name</replaceable> is followed by
|
<para>When the <replaceable>switch-name</replaceable> is followed by
|
||||||
<option>=0</option> or <option>=1</option>, then the switch is
|
<option>=0</option> or <option>=1</option>, then the switch is
|
||||||
initialized to off or on respectively by the start command. Other
|
initialized to off or on respectively by the
|
||||||
commands do not affect the switch setting.</para>
|
<command>start</command> command. Other commands do not affect the
|
||||||
|
switch setting.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
@ -473,12 +473,12 @@
|
|||||||
'!' is supplied, the test is inverted such that the rule is enabled
|
'!' is supplied, the test is inverted such that the rule is enabled
|
||||||
if the file contains 0.</para>
|
if the file contains 0.</para>
|
||||||
|
|
||||||
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
|
<para>Within the <replaceable>switch-name</replaceable>, '@0' and
|
||||||
replaced by the name of the chain to which the rule is a added. The
|
'@{0}' are replaced by the name of the chain to which the rule is a
|
||||||
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
|
added. The <replaceable>switch-name</replaceable> (after '@...'
|
||||||
begin with a letter and be composed of letters, decimal digits,
|
expansion) must begin with a letter and be composed of letters,
|
||||||
underscores or hyphens. Switch names must be 30 characters or less
|
decimal digits, underscores or hyphens. Switch names must be 30
|
||||||
in length.</para>
|
characters or less in length.</para>
|
||||||
|
|
||||||
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
||||||
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
||||||
@ -501,8 +501,9 @@
|
|||||||
<para>Beginning with Shoreawll 4.5.10, when the
|
<para>Beginning with Shoreawll 4.5.10, when the
|
||||||
<replaceable>switch-name</replaceable> is followed by
|
<replaceable>switch-name</replaceable> is followed by
|
||||||
<option>=0</option> or <option>=1</option>, then the switch is
|
<option>=0</option> or <option>=1</option>, then the switch is
|
||||||
initialized to off or on respectively by the start command. Other
|
initialized to off or on respectively by the
|
||||||
commands do not affect the switch setting.</para>
|
<command>start</command> command. Other commands do not affect the
|
||||||
|
switch setting.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@ -1382,12 +1382,12 @@
|
|||||||
'!' is supplied, the test is inverted such that the rule is enabled
|
'!' is supplied, the test is inverted such that the rule is enabled
|
||||||
if the file contains 0.</para>
|
if the file contains 0.</para>
|
||||||
|
|
||||||
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
|
<para>Within the <replaceable>switch-name</replaceable>, '@0' and
|
||||||
replaced by the name of the chain to which the rule is a added. The
|
'@{0}' are replaced by the name of the chain to which the rule is a
|
||||||
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
|
added. The <replaceable>switch-name</replaceable> (after '@...'
|
||||||
begin with a letter and be composed of letters, decimal digits,
|
expansion) must begin with a letter and be composed of letters,
|
||||||
underscores or hyphens. Switch names must be 30 characters or less
|
decimal digits, underscores or hyphens. Switch names must be 30
|
||||||
in length.</para>
|
characters or less in length.</para>
|
||||||
|
|
||||||
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
||||||
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
||||||
@ -1410,8 +1410,9 @@
|
|||||||
<para>Beginning with Shoreawll 4.5.10, when the
|
<para>Beginning with Shoreawll 4.5.10, when the
|
||||||
<replaceable>switch-name</replaceable> is followed by
|
<replaceable>switch-name</replaceable> is followed by
|
||||||
<option>=0</option> or <option>=1</option>, then the switch is
|
<option>=0</option> or <option>=1</option>, then the switch is
|
||||||
initialized to off or on respectively by the start command. Other
|
initialized to off or on respectively by the
|
||||||
commands do not affect the switch setting.</para>
|
<command>start</command> command. Other commands do not affect the
|
||||||
|
switch setting.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@ -295,12 +295,12 @@
|
|||||||
'!' is supplied, the test is inverted such that the rule is enabled
|
'!' is supplied, the test is inverted such that the rule is enabled
|
||||||
if the file contains 0.</para>
|
if the file contains 0.</para>
|
||||||
|
|
||||||
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
|
<para>Within the <replaceable>switch-name</replaceable>, '@0' and
|
||||||
replaced by the name of the chain to which the rule is a added. The
|
'@{0}' are replaced by the name of the chain to which the rule is a
|
||||||
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
|
added. The <replaceable>switch-name</replaceable> (after '@...'
|
||||||
begin with a letter and be composed of letters, decimal digits,
|
expansion) must begin with a letter and be composed of letters,
|
||||||
underscores or hyphens. Switch names must be 30 characters or less
|
decimal digits, underscores or hyphens. Switch names must be 30
|
||||||
in length.</para>
|
characters or less in length.</para>
|
||||||
|
|
||||||
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
||||||
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
||||||
@ -322,8 +322,9 @@
|
|||||||
|
|
||||||
<para>When the <replaceable>switch-name</replaceable> is followed by
|
<para>When the <replaceable>switch-name</replaceable> is followed by
|
||||||
<option>=0</option> or <option>=1</option>, then the switch is
|
<option>=0</option> or <option>=1</option>, then the switch is
|
||||||
initialized to off or on respectively by the start command. Other
|
initialized to off or on respectively by the
|
||||||
commands do not affect the switch setting.</para>
|
<command>start</command> command. Other commands do not affect the
|
||||||
|
switch setting.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
@ -1257,12 +1257,12 @@
|
|||||||
'!' is supplied, the test is inverted such that the rule is enabled
|
'!' is supplied, the test is inverted such that the rule is enabled
|
||||||
if the file contains 0.</para>
|
if the file contains 0.</para>
|
||||||
|
|
||||||
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
|
<para>Within the <replaceable>switch-name</replaceable>, '@0' and
|
||||||
replaced by the name of the chain to which the rule is a added. The
|
'@{0}' are replaced by the name of the chain to which the rule is a
|
||||||
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
|
added. The <replaceable>switch-name</replaceable> (after '@...'
|
||||||
begin with a letter and be composed of letters, decimal digits,
|
expansion) must begin with a letter and be composed of letters,
|
||||||
underscores or hyphens. Switch names must be 30 characters or less
|
decimal digits, underscores or hyphens. Switch names must be 30
|
||||||
in length.</para>
|
characters or less in length.</para>
|
||||||
|
|
||||||
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
||||||
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
||||||
@ -1285,8 +1285,9 @@
|
|||||||
<para>Beginning with Shoreawll 4.5.10, when the
|
<para>Beginning with Shoreawll 4.5.10, when the
|
||||||
<replaceable>switch-name</replaceable> is followed by
|
<replaceable>switch-name</replaceable> is followed by
|
||||||
<option>=0</option> or <option>=1</option>, then the switch is
|
<option>=0</option> or <option>=1</option>, then the switch is
|
||||||
initialized to off or on respectively by the start command. Other
|
initialized to off or on respectively by the
|
||||||
commands do not affect the switch setting.</para>
|
<command>start</command> command. Other commands do not affect the
|
||||||
|
switch setting.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user