mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-18 04:11:22 +01:00
Deimplement option leading ? in embedded directives
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
9dd6f86c55
commit
97cc4930cf
@ -1953,7 +1953,7 @@ sub embedded_shell( $ ) {
|
||||
my $last = 0;
|
||||
|
||||
while ( read_a_line( 0, 0, 1 ) ) {
|
||||
last if $last = $currentline =~ s/^\s*\??END(\s+SHELL)?\s*;?//;
|
||||
last if $last = $currentline =~ s/^\s*END(\s+SHELL)?\s*;?//;
|
||||
$command .= $currentline;
|
||||
}
|
||||
|
||||
@ -1989,7 +1989,7 @@ sub embedded_perl( $ ) {
|
||||
my $last = 0;
|
||||
|
||||
while ( read_a_line( 0, 0, 1 ) ) {
|
||||
last if $last = $currentline =~ s/^\s*\??END(\s+PERL)?\s*;?//;
|
||||
last if $last = $currentline =~ s/^\s*END(\s+PERL)?\s*;?//;
|
||||
$command .= $currentline;
|
||||
}
|
||||
|
||||
@ -2208,12 +2208,12 @@ sub read_a_line(;$$$) {
|
||||
# Must check for shell/perl before doing variable expansion
|
||||
#
|
||||
if ( $embedded_enabled ) {
|
||||
if ( $currentline =~ s/^\s*\??(BEGIN\s+)?SHELL\s*;?// ) {
|
||||
if ( $currentline =~ s/^\s*(BEGIN\s+)?SHELL\s*;?// ) {
|
||||
embedded_shell( $1 );
|
||||
next;
|
||||
}
|
||||
|
||||
if ( $currentline =~ s/^\s*\??(BEGIN\s+)?PERL\s*\;?// ) {
|
||||
if ( $currentline =~ s/^\s*(BEGIN\s+)?PERL\s*\;?// ) {
|
||||
embedded_perl( $1 );
|
||||
next;
|
||||
}
|
||||
|
@ -1601,19 +1601,16 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><emphasis role="bold">[?]PERL</emphasis> <<emphasis>perl
|
||||
<para><emphasis role="bold">PERL</emphasis> <<emphasis>perl
|
||||
script</emphasis>></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">[?]SHELL</emphasis> <<emphasis>shell
|
||||
<para><emphasis role="bold">SHELL</emphasis> <<emphasis>shell
|
||||
script</emphasis>></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>The optional '?' is allowed in Shorewall versions 4.5.2 and
|
||||
later.</para>
|
||||
|
||||
<para>Shell scripts run in a child shell process and their output is piped
|
||||
back to the compiler which processes that output as if it were embedded at
|
||||
the point of the script.</para>
|
||||
@ -1658,14 +1655,13 @@ use Shorewall::Config ( qw/shorewall/ );</programlisting>
|
||||
</orderedlist>
|
||||
|
||||
<para>Multi-line scripts use one of the following forms:<programlisting><emphasis
|
||||
role="bold">[?]BEGIN SHELL</emphasis>
|
||||
role="bold">BEGIN SHELL</emphasis>
|
||||
<<emphasis>shell script</emphasis>>
|
||||
<emphasis role="bold">[?]END</emphasis> [ <emphasis role="bold">SHELL</emphasis> ]</programlisting><programlisting><emphasis
|
||||
role="bold">[?]BEGIN PERL</emphasis> [;]
|
||||
<emphasis role="bold">END</emphasis> [ <emphasis role="bold">SHELL</emphasis> ]</programlisting><programlisting><emphasis
|
||||
role="bold">BEGIN PERL</emphasis> [;]
|
||||
<<emphasis>perl script</emphasis>>
|
||||
<emphasis role="bold">[?]END</emphasis> [ <emphasis role="bold">PERL</emphasis> ] [<emphasis
|
||||
role="bold">;</emphasis>]</programlisting>As above, the optional
|
||||
leading '?' is allowed in Shorewall versions 4.5.2 and later.</para>
|
||||
<emphasis role="bold">END</emphasis> [ <emphasis role="bold">PERL</emphasis> ] [<emphasis
|
||||
role="bold">;</emphasis>]</programlisting></para>
|
||||
</section>
|
||||
|
||||
<section id="dnsnames">
|
||||
|
Loading…
Reference in New Issue
Block a user