Use 'date' format for compiletime rather than localtime format

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-05-06 13:28:22 -07:00
parent d4df67966d
commit 0d16b2820a
7 changed files with 25 additions and 13 deletions

View File

@ -244,7 +244,7 @@ sub create_arptables_load( $ ) {
emit "exec 3>\${VARDIR}/.arptables-input";
my $date = localtime;
my $date = compiletime;
unless ( $test ) {
emit_unindented '#';
@ -294,7 +294,7 @@ sub create_arptables_load( $ ) {
#
sub preview_arptables_load() {
my $date = localtime;
my $date = compiletime;
print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n";

View File

@ -8575,7 +8575,7 @@ sub create_netfilter_load( $ ) {
enter_cat_mode;
my $date = localtime;
my $date = compiletime;
unless ( $test ) {
emit_unindented '#';
@ -8683,7 +8683,7 @@ sub preview_netfilter_load() {
enter_cat_mode1;
my $date = localtime;
my $date = compiletime;
print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n";
@ -8919,7 +8919,7 @@ sub create_stop_load( $ ) {
enter_cat_mode;
unless ( $test ) {
my $date = localtime;
my $date = compiletime;
emit_unindented '#';
emit_unindented "# Generated by Shorewall $globals{VERSION} - $date";
emit_unindented '#';

View File

@ -90,7 +90,7 @@ sub generate_script_1( $ ) {
if ( $test ) {
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall-perl\n#";
} else {
my $date = localtime;
my $date = compiletime;
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#";
@ -600,7 +600,7 @@ EOF
# Generate info_command()
#
sub compile_info_command() {
my $date = localtime;
my $date = compiletime;
emit( "\n",
"#",

View File

@ -84,6 +84,8 @@ our @EXPORT = qw(
require_capability
report_used_capabilities
kernel_version
compiletime
);
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
@ -681,6 +683,8 @@ our %ipsets; # All required IPsets
#
our %filecache;
our $compiletime;
sub process_shorewallrc($$);
sub add_variables( \% );
#
@ -1172,6 +1176,10 @@ sub initialize( $;$$) {
%shorewallrc1 = %shorewallrc unless $shorewallrc1;
add_variables %shorewallrc1;
$compiletime = `date`;
chomp $compiletime;
}
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
@ -1184,6 +1192,10 @@ sub all_ipsets() {
sort keys %ipsets;
}
sub compiletime() {
$compiletime;
}
#
# Create 'currentlineinfo'
#

View File

@ -302,7 +302,7 @@ sub convert_blacklist() {
if ( @rules ) {
my $fn1 = find_writable_file( 'blrules' );
my $blrules;
my $date = localtime;
my $date = compiletime;
if ( -f $fn1 ) {
open $blrules, '>>', $fn1 or fatal_error "Unable to open $fn1: $!";
@ -393,7 +393,7 @@ sub convert_routestopped() {
my ( @allhosts, %source, %dest , %notrack, @rule );
my $seq = 0;
my $date = localtime;
my $date = compiletime;
my ( $stoppedrules, $fn1 );
@ -421,7 +421,7 @@ EOF
first_entry(
sub {
my $date = localtime;
my $date = compiletime;
progress_message2 "$doing $fn...";
print( $stoppedrules
"#\n" ,

View File

@ -368,7 +368,7 @@ sub setup_conntrack($) {
if ( $convert ) {
my $conntrack;
my $empty = 1;
my $date = localtime;
my $date = compiletime;
if ( $fn ) {
open $conntrack, '>>', $fn or fatal_error "Unable to open $fn for notrack conversion: $!";

View File

@ -2166,7 +2166,7 @@ sub convert_tos($$) {
if ( my $fn = open_file 'tos' ) {
first_entry(
sub {
my $date = localtime;
my $date = compiletime;
progress_message2 "Converting $fn...";
print( $mangle
"#\n" ,
@ -2332,7 +2332,7 @@ sub setup_tc( $ ) {
first_entry(
sub {
my $date = localtime;
my $date = compiletime;
progress_message2 "Converting $fn...";
print( $mangle
"#\n" ,