Merge branch '5.0.1'

This commit is contained in:
Tom Eastep 2015-10-28 14:35:27 -07:00
commit 3973cdf0da
5 changed files with 62 additions and 32 deletions

View File

@ -5147,6 +5147,7 @@ sub unsupported_yes_no_warning( $ ) {
# #
sub get_params( $ ) { sub get_params( $ ) {
my $export = $_[0]; my $export = $_[0];
my $cygwin = ( $shorewallrc{HOST} eq 'cygwin' );
my $fn = find_file 'params'; my $fn = find_file 'params';
@ -5188,14 +5189,16 @@ sub get_params( $ ) {
$shell = BASH; $shell = BASH;
for ( @params ) { for ( @params ) {
if ( /^declare -x (.*?)="(.*[^\\])"$/ ) { chomp;
if ( $cygwin && /^declare -x (.*?)="(.*)"$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^declare -x (.*?)="(.*[^\\])"$/ ) {
$params{$1} = $2 unless $1 eq '_'; $params{$1} = $2 unless $1 eq '_';
} elsif ( /^declare -x (.*?)="(.*)$/ ) { } elsif ( /^declare -x (.*?)="(.*)$/ ) {
$params{$variable=$1} = $2 eq '"' ? '' : "${2}\n"; $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
} elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) { } elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) {
$params{$1} = ''; $params{$1} = '';
} else { } else {
chomp;
if ($variable) { if ($variable) {
s/"$//; s/"$//;
$params{$variable} .= $_; $params{$variable} .= $_;
@ -5216,14 +5219,16 @@ sub get_params( $ ) {
$shell = OLDBASH; $shell = OLDBASH;
for ( @params ) { for ( @params ) {
if ( /^export (.*?)="(.*[^\\])"$/ ) { chomp;
if ( $cygwin && /^export (.*?)="(.*)"$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^export (.*?)="(.*[^\\])"$/ ) {
$params{$1} = $2 unless $1 eq '_'; $params{$1} = $2 unless $1 eq '_';
} elsif ( /^export (.*?)="(.*)$/ ) { } elsif ( /^export (.*?)="(.*)$/ ) {
$params{$variable=$1} = $2 eq '"' ? '' : "${2}\n"; $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
} elsif ( /^export ([^\s=]+)\s*$/ || /^export (.*)=""$/ ) { } elsif ( /^export ([^\s=]+)\s*$/ || /^export (.*)=""$/ ) {
$params{$1} = ''; $params{$1} = '';
} else { } else {
chomp;
if ($variable) { if ($variable) {
s/"$//; s/"$//;
$params{$variable} .= $_; $params{$variable} .= $_;
@ -5243,6 +5248,7 @@ sub get_params( $ ) {
$shell = ASH; $shell = ASH;
for ( @params ) { for ( @params ) {
chomp;
if ( /^export (.*?)='(.*'"'"')$/ ) { if ( /^export (.*?)='(.*'"'"')$/ ) {
$params{$variable=$1}="${2}\n"; $params{$variable=$1}="${2}\n";
} elsif ( /^export (.*?)='(.*)'$/ ) { } elsif ( /^export (.*?)='(.*)'$/ ) {
@ -5250,7 +5256,6 @@ sub get_params( $ ) {
} elsif ( /^export (.*?)='(.*)$/ ) { } elsif ( /^export (.*?)='(.*)$/ ) {
$params{$variable=$1}="${2}\n"; $params{$variable=$1}="${2}\n";
} else { } else {
chomp;
if ($variable) { if ($variable) {
s/'$//; s/'$//;
$params{$variable} .= $_; $params{$variable} .= $_;
@ -5262,9 +5267,17 @@ sub get_params( $ ) {
} }
for ( keys %params ) { for ( keys %params ) {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) { if ( /[^\w]/ ) {
fatal_error "The variable name $_ is reserved and may not be set in the params file" delete $params{$_};
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_}; } elsif ( /^(?:SHLVL|OLDPWD)$/ ) {
delete $params{$_};
} else {
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) {
fatal_error "The variable name $_ is reserved and may not be set in the params file"
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
}
$params{$_} = '' unless defined $params{$_};
} }
} }
@ -5314,6 +5327,8 @@ sub export_params() {
next if exists $compiler_params{$param}; next if exists $compiler_params{$param};
my $value = $params{$param}; my $value = $params{$param};
chomp $value;
# #
# Values in %params are generated from the output of 'export -p'. # Values in %params are generated from the output of 'export -p'.
# The different shells have different conventions for delimiting # The different shells have different conventions for delimiting
@ -5324,19 +5339,27 @@ sub export_params() {
$value =~ s/\\"/"/g; $value =~ s/\\"/"/g;
} elsif ( $shell == OLDBASH ) { } elsif ( $shell == OLDBASH ) {
$value =~ s/\\'/'/g; $value =~ s/\\'/'/g;
$value =~ s/\\"/"/g;
$value =~ s/\\\\/\\/g;
} else { } else {
$value =~ s/'"'"'/'/g; $value =~ s/'"'"'/'/g;
} }
# #
# Don't export pairs from %ENV # Don't export pairs from %ENV
# #
next if defined $ENV{$param} && $value eq $ENV{$param}; if ( defined $ENV{$param} ) {
next if $value eq $ENV{$param};
} elsif ( exists $ENV{$param} ) {
next unless supplied $value;
}
emit "#\n# From the params file\n#" unless $count++; emit "#\n# From the params file\n#" unless $count++;
# #
# We will use double quotes and escape embedded quotes with \. # We will use double quotes and escape embedded quotes with \.
# #
if ( $value =~ /[\s()['"]/ ) { if ( $value =~ /^"[^"]*"$/ ) {
emit "$param=$value";
} elsif ( $value =~ /[\s()['"]/ ) {
$value =~ s/"/\\"/g; $value =~ s/"/\\"/g;
emit "$param='$value'"; emit "$param='$value'";
} else { } else {

View File

@ -424,7 +424,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>remote_start</option></arg> <arg choice="plain"><option>remote-start</option></arg>
<arg><option>-s</option></arg> <arg><option>-s</option></arg>
@ -448,7 +448,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>remote_reload</option></arg> <arg choice="plain"><option>remote-reload</option></arg>
<arg><option>-s</option></arg> <arg><option>-s</option></arg>
@ -472,7 +472,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>remote_restart</option></arg> <arg choice="plain"><option>remote-restart</option></arg>
<arg><option>-s</option></arg> <arg><option>-s</option></arg>
@ -1522,7 +1522,7 @@
<listitem> <listitem>
<para>This command was re-implemented in Shorewall 5.0.0. The <para>This command was re-implemented in Shorewall 5.0.0. The
pre-5.0.0 <command>reload</command> command is now called pre-5.0.0 <command>reload</command> command is now called
<command>remote_restart</command> (see below).</para> <command>remote-restart</command> (see below).</para>
<para>Reload is similar to <emphasis role="bold">shorewall <para>Reload is similar to <emphasis role="bold">shorewall
start</emphasis> except that it assumes that the firewall is already start</emphasis> except that it assumes that the firewall is already
@ -1575,7 +1575,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">remote_start</emphasis> <term><emphasis role="bold">remote-start</emphasis>
[-<option>s</option>] [-<option>c</option>] [-<option>r</option> [-<option>s</option>] [-<option>c</option>] [-<option>r</option>
<replaceable>root-user-name</replaceable>] [-<option>T</option>] <replaceable>root-user-name</replaceable>] [-<option>T</option>]
[-<option>i</option>] [ <replaceable>directory</replaceable> ] [-<option>i</option>] [ <replaceable>directory</replaceable> ]
@ -1637,7 +1637,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">remote_reload <term><emphasis role="bold">remote-reload
</emphasis>[-<option>s</option>] [-<option>c</option>] </emphasis>[-<option>s</option>] [-<option>c</option>]
[-<option>r</option> <replaceable>root-user-name</replaceable>] [-<option>r</option> <replaceable>root-user-name</replaceable>]
[-<option>T</option>] [-<option>i</option>] [ [-<option>T</option>] [-<option>i</option>] [
@ -1699,7 +1699,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">remote_restart <term><emphasis role="bold">remote-restart
</emphasis>[-<option>s</option>] [-<option>c</option>] </emphasis>[-<option>s</option>] [-<option>c</option>]
[-<option>r</option> <replaceable>root-user-name</replaceable>] [-<option>r</option> <replaceable>root-user-name</replaceable>]
[-<option>T</option>] [-<option>i</option>] [ [-<option>T</option>] [-<option>i</option>] [

View File

@ -378,7 +378,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>remote_start</option></arg> <arg choice="plain"><option>remote-start</option></arg>
<arg><option>-s</option></arg> <arg><option>-s</option></arg>
@ -402,7 +402,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>remote_reload</option></arg> <arg choice="plain"><option>remote-reload</option></arg>
<arg><option>-s</option></arg> <arg><option>-s</option></arg>
@ -426,7 +426,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>remote_restart</option></arg> <arg choice="plain"><option>remote-restart</option></arg>
<arg><option>-s</option></arg> <arg><option>-s</option></arg>
@ -1457,7 +1457,7 @@
<listitem> <listitem>
<para>This command was re-implemented in Shorewall 5.0.0. The <para>This command was re-implemented in Shorewall 5.0.0. The
pre-5.0.0 <command>reload</command> command is now called pre-5.0.0 <command>reload</command> command is now called
<command>remote_restart</command> (see below).</para> <command>remote-restart</command> (see below).</para>
<para>Reload is similar to <command>shorewall6 start</command> <para>Reload is similar to <command>shorewall6 start</command>
except that it assumes that the firewall is already started. except that it assumes that the firewall is already started.
@ -1511,7 +1511,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">remote_reload <term><emphasis role="bold">remote-reload
</emphasis>[-<option>s</option>] [-<option>c</option>] </emphasis>[-<option>s</option>] [-<option>c</option>]
[-<option>r</option> <replaceable>root-user-name</replaceable>] [-<option>r</option> <replaceable>root-user-name</replaceable>]
[-<option>T</option>] [-<option>i</option>] [ [-<option>T</option>] [-<option>i</option>] [
@ -1573,7 +1573,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">remote_ restart <term><emphasis role="bold">remote- restart
</emphasis>[-<option>s</option>] [-<option>c</option>] </emphasis>[-<option>s</option>] [-<option>c</option>]
[-<option>r</option> <replaceable>root-user-name</replaceable>] [-<option>r</option> <replaceable>root-user-name</replaceable>]
[-<option>T</option>] [-<option>i</option>] [ [-<option>T</option>] [-<option>i</option>] [
@ -1636,7 +1636,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">remote_start </emphasis> <term><emphasis role="bold">remote-start </emphasis>
[-<option>s</option>] [-<option>c</option>] [-<option>r</option> [-<option>s</option>] [-<option>c</option>] [-<option>r</option>
<replaceable>root-user-name</replaceable>] [-<option>T</option>] <replaceable>root-user-name</replaceable>] [-<option>T</option>]
[-<option>i</option>] [ <replaceable>directory</replaceable> ] [-<option>i</option>] [ <replaceable>directory</replaceable> ]

View File

@ -323,7 +323,7 @@
<title>load</title> <title>load</title>
<para>The function performed by the Shorewall-4 <command>load</command> <para>The function performed by the Shorewall-4 <command>load</command>
command is now performed by the <command>remote_start</command> command is now performed by the <command>remote-start</command>
command.</para> command.</para>
</section> </section>
@ -334,7 +334,7 @@
the same function as the <command>restart</command> command did in the same function as the <command>restart</command> command did in
Shorewall 4. The action taken by the Shorewall-4 Shorewall 4. The action taken by the Shorewall-4
<command>reload</command> command is now performed by the <command>reload</command> command is now performed by the
<command>remote_restart</command> command.</para> <command>remote-restart</command> command.</para>
<para>For those that can't get used to the idea of using <para>For those that can't get used to the idea of using
<command>reload</command> in place of <command>restart</command>, a <command>reload</command> in place of <command>restart</command>, a

View File

@ -37,7 +37,7 @@
<holder>Thomas M. Eastep</holder> <holder>Thomas M. Eastep</holder>
<holder></holder> <holder/>
</copyright> </copyright>
<legalnotice> <legalnotice>
@ -78,6 +78,13 @@
zones.</para> zones.</para>
</section> </section>
<section>
<title>Version &gt;= 5.0.0</title>
<para>See the <ulink url="Shorewall-5.html">Shorewall 5
documentation</ulink>.</para>
</section>
<section> <section>
<title>Version &gt;= 4.6.0</title> <title>Version &gt;= 4.6.0</title>
@ -85,7 +92,7 @@
<listitem> <listitem>
<para>Beginning with Shorewall 4.6.0, ection headers are now preceded <para>Beginning with Shorewall 4.6.0, ection headers are now preceded
by '?' (e.g., '?SECTION ...'). If your configuration contains any bare by '?' (e.g., '?SECTION ...'). If your configuration contains any bare
'SECTION' entries, the following warning is issued: </para> 'SECTION' entries, the following warning is issued:</para>
<programlisting>WARNING: 'SECTION' is deprecated in favor of '?SECTION' - consider running 'shorewall update -D' ...</programlisting> <programlisting>WARNING: 'SECTION' is deprecated in favor of '?SECTION' - consider running 'shorewall update -D' ...</programlisting>
@ -111,7 +118,7 @@
</listitem> </listitem>
<listitem> <listitem>
<para> Beginning with Shorewall 4.5.0, FORMAT-1 actions and macros are <para>Beginning with Shorewall 4.5.0, FORMAT-1 actions and macros are
deprecated and a warning will be issued for each FORMAT-1 action or deprecated and a warning will be issued for each FORMAT-1 action or
macro found.</para> macro found.</para>
@ -119,8 +126,8 @@
<programlisting>WARNING: FORMAT-1 macros are deprecated and support will be dropped in a future release.</programlisting> <programlisting>WARNING: FORMAT-1 macros are deprecated and support will be dropped in a future release.</programlisting>
<para> To eliminate these warnings, add the following line before the <para>To eliminate these warnings, add the following line before the
first rule in the action or macro: </para> first rule in the action or macro:</para>
<programlisting>?FORMAT 2</programlisting> <programlisting>?FORMAT 2</programlisting>
@ -325,7 +332,7 @@
<para>?ENDIF.</para> <para>?ENDIF.</para>
</blockquote> </blockquote>
<para></para> <para/>
</listitem> </listitem>
<listitem> <listitem>