Deimplement option leading ? in embedded directives

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-04-06 16:26:05 -07:00
parent 9dd6f86c55
commit 97cc4930cf
2 changed files with 11 additions and 15 deletions

View File

@ -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;
} }

View File

@ -1601,19 +1601,16 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2&gt; /dev/null || true</programlisting
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para><emphasis role="bold">[?]PERL</emphasis> &lt;<emphasis>perl <para><emphasis role="bold">PERL</emphasis> &lt;<emphasis>perl
script</emphasis>&gt;</para> script</emphasis>&gt;</para>
</listitem> </listitem>
<listitem> <listitem>
<para><emphasis role="bold">[?]SHELL</emphasis> &lt;<emphasis>shell <para><emphasis role="bold">SHELL</emphasis> &lt;<emphasis>shell
script</emphasis>&gt;</para> script</emphasis>&gt;</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>
&lt;<emphasis>shell script</emphasis>&gt; &lt;<emphasis>shell script</emphasis>&gt;
<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> [;]
&lt;<emphasis>perl script</emphasis>&gt; &lt;<emphasis>perl script</emphasis>&gt;
<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">