forked from extern/shorewall_code
Merge branch '5.0.1'
This commit is contained in:
commit
3973cdf0da
@ -5147,6 +5147,7 @@ sub unsupported_yes_no_warning( $ ) {
|
||||
#
|
||||
sub get_params( $ ) {
|
||||
my $export = $_[0];
|
||||
my $cygwin = ( $shorewallrc{HOST} eq 'cygwin' );
|
||||
|
||||
my $fn = find_file 'params';
|
||||
|
||||
@ -5188,14 +5189,16 @@ sub get_params( $ ) {
|
||||
$shell = BASH;
|
||||
|
||||
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 '_';
|
||||
} elsif ( /^declare -x (.*?)="(.*)$/ ) {
|
||||
$params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
|
||||
} elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) {
|
||||
$params{$1} = '';
|
||||
} else {
|
||||
chomp;
|
||||
if ($variable) {
|
||||
s/"$//;
|
||||
$params{$variable} .= $_;
|
||||
@ -5216,14 +5219,16 @@ sub get_params( $ ) {
|
||||
$shell = OLDBASH;
|
||||
|
||||
for ( @params ) {
|
||||
if ( /^export (.*?)="(.*[^\\])"$/ ) {
|
||||
chomp;
|
||||
if ( $cygwin && /^export (.*?)="(.*)"$/ ) {
|
||||
$params{$1} = $2 unless $1 eq '_';
|
||||
} elsif ( /^export (.*?)="(.*[^\\])"$/ ) {
|
||||
$params{$1} = $2 unless $1 eq '_';
|
||||
} elsif ( /^export (.*?)="(.*)$/ ) {
|
||||
$params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
|
||||
} elsif ( /^export ([^\s=]+)\s*$/ || /^export (.*)=""$/ ) {
|
||||
$params{$1} = '';
|
||||
} else {
|
||||
chomp;
|
||||
if ($variable) {
|
||||
s/"$//;
|
||||
$params{$variable} .= $_;
|
||||
@ -5243,6 +5248,7 @@ sub get_params( $ ) {
|
||||
$shell = ASH;
|
||||
|
||||
for ( @params ) {
|
||||
chomp;
|
||||
if ( /^export (.*?)='(.*'"'"')$/ ) {
|
||||
$params{$variable=$1}="${2}\n";
|
||||
} elsif ( /^export (.*?)='(.*)'$/ ) {
|
||||
@ -5250,7 +5256,6 @@ sub get_params( $ ) {
|
||||
} elsif ( /^export (.*?)='(.*)$/ ) {
|
||||
$params{$variable=$1}="${2}\n";
|
||||
} else {
|
||||
chomp;
|
||||
if ($variable) {
|
||||
s/'$//;
|
||||
$params{$variable} .= $_;
|
||||
@ -5262,9 +5267,17 @@ sub get_params( $ ) {
|
||||
}
|
||||
|
||||
for ( keys %params ) {
|
||||
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{$_};
|
||||
if ( /[^\w]/ ) {
|
||||
delete $params{$_};
|
||||
} 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};
|
||||
|
||||
my $value = $params{$param};
|
||||
|
||||
chomp $value;
|
||||
#
|
||||
# Values in %params are generated from the output of 'export -p'.
|
||||
# The different shells have different conventions for delimiting
|
||||
@ -5324,19 +5339,27 @@ sub export_params() {
|
||||
$value =~ s/\\"/"/g;
|
||||
} elsif ( $shell == OLDBASH ) {
|
||||
$value =~ s/\\'/'/g;
|
||||
$value =~ s/\\"/"/g;
|
||||
$value =~ s/\\\\/\\/g;
|
||||
} else {
|
||||
$value =~ s/'"'"'/'/g;
|
||||
}
|
||||
#
|
||||
# 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++;
|
||||
#
|
||||
# We will use double quotes and escape embedded quotes with \.
|
||||
#
|
||||
if ( $value =~ /[\s()['"]/ ) {
|
||||
if ( $value =~ /^"[^"]*"$/ ) {
|
||||
emit "$param=$value";
|
||||
} elsif ( $value =~ /[\s()['"]/ ) {
|
||||
$value =~ s/"/\\"/g;
|
||||
emit "$param='$value'";
|
||||
} else {
|
||||
|
@ -424,7 +424,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@ -448,7 +448,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@ -472,7 +472,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@ -1522,7 +1522,7 @@
|
||||
<listitem>
|
||||
<para>This command was re-implemented in Shorewall 5.0.0. The
|
||||
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
|
||||
start</emphasis> except that it assumes that the firewall is already
|
||||
@ -1575,7 +1575,7 @@
|
||||
</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>
|
||||
<replaceable>root-user-name</replaceable>] [-<option>T</option>]
|
||||
[-<option>i</option>] [ <replaceable>directory</replaceable> ]
|
||||
@ -1637,7 +1637,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">remote_reload
|
||||
<term><emphasis role="bold">remote-reload
|
||||
</emphasis>[-<option>s</option>] [-<option>c</option>]
|
||||
[-<option>r</option> <replaceable>root-user-name</replaceable>]
|
||||
[-<option>T</option>] [-<option>i</option>] [
|
||||
@ -1699,7 +1699,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">remote_restart
|
||||
<term><emphasis role="bold">remote-restart
|
||||
</emphasis>[-<option>s</option>] [-<option>c</option>]
|
||||
[-<option>r</option> <replaceable>root-user-name</replaceable>]
|
||||
[-<option>T</option>] [-<option>i</option>] [
|
||||
|
@ -378,7 +378,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@ -402,7 +402,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@ -426,7 +426,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@ -1457,7 +1457,7 @@
|
||||
<listitem>
|
||||
<para>This command was re-implemented in Shorewall 5.0.0. The
|
||||
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>
|
||||
except that it assumes that the firewall is already started.
|
||||
@ -1511,7 +1511,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">remote_reload
|
||||
<term><emphasis role="bold">remote-reload
|
||||
</emphasis>[-<option>s</option>] [-<option>c</option>]
|
||||
[-<option>r</option> <replaceable>root-user-name</replaceable>]
|
||||
[-<option>T</option>] [-<option>i</option>] [
|
||||
@ -1573,7 +1573,7 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">remote_ restart
|
||||
<term><emphasis role="bold">remote- restart
|
||||
</emphasis>[-<option>s</option>] [-<option>c</option>]
|
||||
[-<option>r</option> <replaceable>root-user-name</replaceable>]
|
||||
[-<option>T</option>] [-<option>i</option>] [
|
||||
@ -1636,7 +1636,7 @@
|
||||
</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>
|
||||
<replaceable>root-user-name</replaceable>] [-<option>T</option>]
|
||||
[-<option>i</option>] [ <replaceable>directory</replaceable> ]
|
||||
|
@ -323,7 +323,7 @@
|
||||
<title>load</title>
|
||||
|
||||
<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>
|
||||
</section>
|
||||
|
||||
@ -334,7 +334,7 @@
|
||||
the same function as the <command>restart</command> command did in
|
||||
Shorewall 4. The action taken by the Shorewall-4
|
||||
<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
|
||||
<command>reload</command> in place of <command>restart</command>, a
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
|
||||
<holder></holder>
|
||||
<holder/>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
@ -78,6 +78,13 @@
|
||||
zones.</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Version >= 5.0.0</title>
|
||||
|
||||
<para>See the <ulink url="Shorewall-5.html">Shorewall 5
|
||||
documentation</ulink>.</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Version >= 4.6.0</title>
|
||||
|
||||
@ -85,7 +92,7 @@
|
||||
<listitem>
|
||||
<para>Beginning with Shorewall 4.6.0, ection headers are now preceded
|
||||
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>
|
||||
|
||||
@ -111,7 +118,7 @@
|
||||
</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
|
||||
macro found.</para>
|
||||
|
||||
@ -119,8 +126,8 @@
|
||||
|
||||
<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
|
||||
first rule in the action or macro: </para>
|
||||
<para>To eliminate these warnings, add the following line before the
|
||||
first rule in the action or macro:</para>
|
||||
|
||||
<programlisting>?FORMAT 2</programlisting>
|
||||
|
||||
@ -325,7 +332,7 @@
|
||||
<para>?ENDIF.</para>
|
||||
</blockquote>
|
||||
|
||||
<para></para>
|
||||
<para/>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
Loading…
Reference in New Issue
Block a user