forked from extern/shorewall_code
Merge branch 'master' of ssh://server.shorewall.net/home/teastep/shorewall/code
This commit is contained in:
commit
227db0cfa7
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shorewall IPv4 firewall (lite)
|
Description=Shorewall IPv4 firewall (lite)
|
||||||
After=network.target
|
After=network-online.target
|
||||||
Conflicts=iptables.service firewalld.service
|
Conflicts=iptables.service firewalld.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
@ -649,10 +649,7 @@ sub compiler {
|
|||||||
|
|
||||||
set_config_path( $config_path ) if $config_path;
|
set_config_path( $config_path ) if $config_path;
|
||||||
|
|
||||||
if ( $directory ne '' ) {
|
set_shorewall_dir( $directory ) if $directory ne '';
|
||||||
fatal_error "$directory is not an existing directory" unless -d $directory;
|
|
||||||
set_shorewall_dir( $directory );
|
|
||||||
}
|
|
||||||
|
|
||||||
$verbosity = 1 if $debug && $verbosity < 1;
|
$verbosity = 1 if $debug && $verbosity < 1;
|
||||||
|
|
||||||
@ -665,15 +662,6 @@ sub compiler {
|
|||||||
#
|
#
|
||||||
get_configuration( $export , $update , $annotate , $directives , $inline );
|
get_configuration( $export , $update , $annotate , $directives , $inline );
|
||||||
#
|
#
|
||||||
# Create a temp file to hold the script
|
|
||||||
#
|
|
||||||
if ( $scriptfilename ) {
|
|
||||||
set_command( 'compile', 'Compiling', 'Compiled' );
|
|
||||||
create_temp_script( $scriptfilename , $export );
|
|
||||||
} else {
|
|
||||||
set_command( 'check', 'Checking', 'Checked' );
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# Chain table initialization depends on shorewall.conf and capabilities. So it must be deferred until
|
# Chain table initialization depends on shorewall.conf and capabilities. So it must be deferred until
|
||||||
# now when shorewall.conf has been processed and the capabilities have been determined.
|
# now when shorewall.conf has been processed and the capabilities have been determined.
|
||||||
#
|
#
|
||||||
@ -683,6 +671,15 @@ sub compiler {
|
|||||||
#
|
#
|
||||||
run_user_exit1 'compile';
|
run_user_exit1 'compile';
|
||||||
#
|
#
|
||||||
|
# Create a temp file to hold the script
|
||||||
|
#
|
||||||
|
if ( $scriptfilename ) {
|
||||||
|
set_command( 'compile', 'Compiling', 'Compiled' );
|
||||||
|
create_temp_script( $scriptfilename , $export );
|
||||||
|
} else {
|
||||||
|
set_command( 'check', 'Checking', 'Checked' );
|
||||||
|
}
|
||||||
|
#
|
||||||
# Z O N E D E F I N I T I O N
|
# Z O N E D E F I N I T I O N
|
||||||
# (Produces no output to the compiled script)
|
# (Produces no output to the compiled script)
|
||||||
#
|
#
|
||||||
|
@ -1268,9 +1268,7 @@ sub cleanup_iptables() {
|
|||||||
qt1( "$iptables $iptablesw -t raw -X $sillyname" );
|
qt1( "$iptables $iptablesw -t raw -X $sillyname" );
|
||||||
}
|
}
|
||||||
|
|
||||||
$sillyname = $sillyname1 = undef;
|
$sillyname = $sillyname1 = '';
|
||||||
|
|
||||||
$sillyname = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1591,7 +1589,7 @@ sub set_command( $$$ ) {
|
|||||||
#
|
#
|
||||||
# Print the current TOD to STDOUT.
|
# Print the current TOD to STDOUT.
|
||||||
#
|
#
|
||||||
sub timestamp() {
|
sub get_localtime() {
|
||||||
our @localtime = localtime;
|
our @localtime = localtime;
|
||||||
printf '%02d:%02d:%02d ', @localtime[2,1,0];
|
printf '%02d:%02d:%02d ', @localtime[2,1,0];
|
||||||
}
|
}
|
||||||
@ -1608,7 +1606,7 @@ sub progress_message {
|
|||||||
$line =~ s/\s+/ /g;
|
$line =~ s/\s+/ /g;
|
||||||
|
|
||||||
if ( $verbosity > 1 ) {
|
if ( $verbosity > 1 ) {
|
||||||
timestamp, $havelocaltime = 1 if $timestamp;
|
get_localtime, $havelocaltime = 1 if $timestamp;
|
||||||
#
|
#
|
||||||
# We use this function to display messages containing raw config file images which may contains tabs (including multiple tabs in succession).
|
# We use this function to display messages containing raw config file images which may contains tabs (including multiple tabs in succession).
|
||||||
# The following makes such messages look more readable and uniform
|
# The following makes such messages look more readable and uniform
|
||||||
@ -1631,7 +1629,7 @@ sub progress_message_nocompress {
|
|||||||
my $havelocaltime = 0;
|
my $havelocaltime = 0;
|
||||||
|
|
||||||
if ( $verbosity > 1 ) {
|
if ( $verbosity > 1 ) {
|
||||||
timestamp, $havelocaltime = 1 if $timestamp;
|
get_localtime, $havelocaltime = 1 if $timestamp;
|
||||||
print "@_\n";
|
print "@_\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1652,7 +1650,7 @@ sub progress_message2 {
|
|||||||
my $havelocaltime = 0;
|
my $havelocaltime = 0;
|
||||||
|
|
||||||
if ( $verbosity > 0 ) {
|
if ( $verbosity > 0 ) {
|
||||||
timestamp, $havelocaltime = 1 if $timestamp;
|
get_localtime, $havelocaltime = 1 if $timestamp;
|
||||||
print "@_\n";
|
print "@_\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1673,7 +1671,7 @@ sub progress_message3 {
|
|||||||
my $havelocaltime = 0;
|
my $havelocaltime = 0;
|
||||||
|
|
||||||
if ( $verbosity >= 0 ) {
|
if ( $verbosity >= 0 ) {
|
||||||
timestamp, $havelocaltime = 1 if $timestamp;
|
get_localtime, $havelocaltime = 1 if $timestamp;
|
||||||
print "@_\n";
|
print "@_\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1762,7 +1760,7 @@ sub create_temp_script( $$ ) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate the SHA1 digest of the (incomplete script)
|
# Generate the SHA1 digest of the (incomplete) script
|
||||||
#
|
#
|
||||||
sub generate_sha1() {
|
sub generate_sha1() {
|
||||||
my $data = `cat $tempfile`;
|
my $data = `cat $tempfile`;
|
||||||
@ -1840,7 +1838,7 @@ sub set_config_path( $ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set $debug
|
# Set $debug and $confess
|
||||||
#
|
#
|
||||||
sub set_debug( $$ ) {
|
sub set_debug( $$ ) {
|
||||||
$debug = shift;
|
$debug = shift;
|
||||||
@ -1865,6 +1863,9 @@ sub find_file($)
|
|||||||
"$config_path[0]$filename";
|
"$config_path[0]$filename";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Split a comma-separated list into a Perl array
|
||||||
|
#
|
||||||
sub split_list( $$;$ ) {
|
sub split_list( $$;$ ) {
|
||||||
my ($list, $type, $origlist ) = @_;
|
my ($list, $type, $origlist ) = @_;
|
||||||
|
|
||||||
@ -1873,6 +1874,9 @@ sub split_list( $$;$ ) {
|
|||||||
split /,/, $list;
|
split /,/, $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# This version handles parenthetical list elements with embedded commas. It removes the parentheses
|
||||||
|
#
|
||||||
sub split_list1( $$;$ ) {
|
sub split_list1( $$;$ ) {
|
||||||
my ($list, $type, $keepparens ) = @_;
|
my ($list, $type, $keepparens ) = @_;
|
||||||
|
|
||||||
@ -2024,6 +2028,9 @@ sub split_list3( $$ ) {
|
|||||||
@list2;
|
@list2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Splits the columns of a config file record
|
||||||
|
#
|
||||||
sub split_columns( $ ) {
|
sub split_columns( $ ) {
|
||||||
my ($list) = @_;
|
my ($list) = @_;
|
||||||
|
|
||||||
@ -4752,6 +4759,7 @@ sub ensure_config_path() {
|
|||||||
#
|
#
|
||||||
sub set_shorewall_dir( $ ) {
|
sub set_shorewall_dir( $ ) {
|
||||||
$shorewall_dir = shift;
|
$shorewall_dir = shift;
|
||||||
|
fatal_error "$shorewall_dir is not an existing directory" unless -d $shorewall_dir;
|
||||||
ensure_config_path;
|
ensure_config_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shorewall IPv4 firewall
|
Description=Shorewall IPv4 firewall
|
||||||
After=network.target
|
After=network-online.target
|
||||||
Conflicts=iptables.service firewalld.service
|
Conflicts=iptables.service firewalld.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shorewall IPv6 firewall (lite)
|
Description=Shorewall IPv6 firewall (lite)
|
||||||
After=network.target
|
After=network-online.target
|
||||||
Conflicts=ip6tables.service firewalld.service
|
Conflicts=ip6tables.service firewalld.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shorewall IPv6 firewall
|
Description=Shorewall IPv6 firewall
|
||||||
After=network.target
|
After=network-online.target
|
||||||
Conflicts=ip6tables.service firewalld.service
|
Conflicts=ip6tables.service firewalld.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Loading…
Reference in New Issue
Block a user