mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-19 12:50:57 +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;
|
my $last = 0;
|
||||||
|
|
||||||
while ( read_a_line( 0, 0, 1 ) ) {
|
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;
|
$command .= $currentline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1989,7 +1989,7 @@ sub embedded_perl( $ ) {
|
|||||||
my $last = 0;
|
my $last = 0;
|
||||||
|
|
||||||
while ( read_a_line( 0, 0, 1 ) ) {
|
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;
|
$command .= $currentline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2208,12 +2208,12 @@ sub read_a_line(;$$$) {
|
|||||||
# Must check for shell/perl before doing variable expansion
|
# Must check for shell/perl before doing variable expansion
|
||||||
#
|
#
|
||||||
if ( $embedded_enabled ) {
|
if ( $embedded_enabled ) {
|
||||||
if ( $currentline =~ s/^\s*\??(BEGIN\s+)?SHELL\s*;?// ) {
|
if ( $currentline =~ s/^\s*(BEGIN\s+)?SHELL\s*;?// ) {
|
||||||
embedded_shell( $1 );
|
embedded_shell( $1 );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $currentline =~ s/^\s*\??(BEGIN\s+)?PERL\s*\;?// ) {
|
if ( $currentline =~ s/^\s*(BEGIN\s+)?PERL\s*\;?// ) {
|
||||||
embedded_perl( $1 );
|
embedded_perl( $1 );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
@ -1601,19 +1601,16 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><emphasis role="bold">[?]PERL</emphasis> <<emphasis>perl
|
<para><emphasis role="bold">PERL</emphasis> <<emphasis>perl
|
||||||
script</emphasis>></para>
|
script</emphasis>></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><emphasis role="bold">[?]SHELL</emphasis> <<emphasis>shell
|
<para><emphasis role="bold">SHELL</emphasis> <<emphasis>shell
|
||||||
script</emphasis>></para>
|
script</emphasis>></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</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
|
<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
|
back to the compiler which processes that output as if it were embedded at
|
||||||
the point of the script.</para>
|
the point of the script.</para>
|
||||||
@ -1658,14 +1655,13 @@ use Shorewall::Config ( qw/shorewall/ );</programlisting>
|
|||||||
</orderedlist>
|
</orderedlist>
|
||||||
|
|
||||||
<para>Multi-line scripts use one of the following forms:<programlisting><emphasis
|
<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>shell script</emphasis>>
|
||||||
<emphasis role="bold">[?]END</emphasis> [ <emphasis role="bold">SHELL</emphasis> ]</programlisting><programlisting><emphasis
|
<emphasis role="bold">END</emphasis> [ <emphasis role="bold">SHELL</emphasis> ]</programlisting><programlisting><emphasis
|
||||||
role="bold">[?]BEGIN PERL</emphasis> [;]
|
role="bold">BEGIN PERL</emphasis> [;]
|
||||||
<<emphasis>perl script</emphasis>>
|
<<emphasis>perl script</emphasis>>
|
||||||
<emphasis role="bold">[?]END</emphasis> [ <emphasis role="bold">PERL</emphasis> ] [<emphasis
|
<emphasis role="bold">END</emphasis> [ <emphasis role="bold">PERL</emphasis> ] [<emphasis
|
||||||
role="bold">;</emphasis>]</programlisting>As above, the optional
|
role="bold">;</emphasis>]</programlisting></para>
|
||||||
leading '?' is allowed in Shorewall versions 4.5.2 and later.</para>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="dnsnames">
|
<section id="dnsnames">
|
||||||
|
Loading…
Reference in New Issue
Block a user