]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Make generated copyright year be "now"
authorRich Salz <rsalz@akamai.com>
Tue, 7 Jan 2020 20:50:20 +0000 (15:50 -0500)
committerRich Salz <rsalz@akamai.com>
Tue, 7 Jan 2020 20:53:15 +0000 (15:53 -0500)
Always use the current year in generating output files, rather than
trying to base is on the modtime of the script or input, as that can
vary depending on the ability of the local OS to keep those accurate.

Fixes #10744

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10776)

crypto/asn1/charmap.pl
crypto/bn/bn_prime.pl
crypto/conf/keysets.pl
crypto/objects/obj_dat.pl
crypto/objects/objects.pl
crypto/objects/objxref.pl
fuzz/mkfuzzoids.pl

index d29a21b3a78479a43a302dea0cda4e08028e0d63..8130c826ad7d02c663066a133abbd2518eac90ce 100644 (file)
@@ -82,8 +82,8 @@ $arr[ord("?")] |= $PSTRING_CHAR;
 
 # Now generate the C code
 
-# Output year depends on the year of the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
+# Year the file was generated.
+my $YEAR = [localtime()]->[5] + 1900;
 print <<EOF;
 /*
  * WARNING: do not edit!
index 76df3fc590e37d7706d2148240c891ca0f455883..b6b546b9060fc6de36744cfbf4627955edb37e0a 100644 (file)
@@ -6,8 +6,8 @@
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
 
-# Output year depends on the year of the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
+# The year the output file is generated.
+my $YEAR = [localtime()]->[5] + 1900;
 print <<"EOF";
 /*
  * WARNING: do not edit!
index b0e2249364d833646e57b36f58bc830aad5ba4be..42c1988345959b270037763b35980af27e4a9d4c 100644 (file)
@@ -57,9 +57,8 @@ foreach (0 .. 127) {
     push(@V_w32, $v);
 }
 
-# Output year depends on the year of the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-
+# The year the output file is generated.
+my $YEAR = [localtime()]->[5] + 1900;
 print <<"EOF";
 /*
  * WARNING: do not edit!
index 24f09b49e5e64a83579a95ae7a560521df70c4e4..2cee3e19ead4abd5d34a01f5d4626c943dfa8eb2 100644 (file)
@@ -36,10 +36,8 @@ sub der_it
     return $ret;
 }
 
-# Output year depends on the year of the script and the input file.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($ARGV[0])]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = [localtime()]->[5] + 1900;
 
 # Read input, parse all #define's into OID name and value.
 # Populate %ln and %sn with long and short names (%dupln and %dupsn)
index 62d6b44bab68fbab49c7f02885a7d7845fe503bf..f4f11fa45208e1399652bf3fa7e2b6f1d68865a9 100644 (file)
@@ -11,12 +11,8 @@ use Getopt::Std;
 our($opt_n);
 getopts('n');
 
-# Output year depends on the year of the script and the input file.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($ARGV[0])]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
-$iYEAR = [localtime([stat($ARGV[1])]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = [localtime()]->[5] + 1900;
 
 open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
 $max_nid=0;
index e6b69a830964f9a7b06ba74ca54831651c6d069d..01ecf438f0b6b38416ffa55277d54a4772d03d5d 100644 (file)
@@ -14,12 +14,8 @@ my %oid_tbl;
 
 my ($mac_file, $xref_file) = @ARGV;
 
-# Output year depends on the year of the script and the input file.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($mac_file)]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
-$iYEAR = [localtime([stat($xref_file)]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = [localtime()]->[5] + 1900;
 
 open(IN, $mac_file) || die "Can't open $mac_file, $!\n";
 
index 89cf7bb583dfd45635133b1699ca5be98bce8b9c..050b5b7047be8cf71f26ff83390cf6230b1f9bff 100755 (executable)
@@ -8,10 +8,8 @@
 
 my $obj_dat_h = $ARGV[0];
 
-# Output year depends on the date on the input file and the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($obj_dat_h)]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = [localtime()]->[5] + 1900;
 
 open IN, '<', $obj_dat_h
     || die "Couldn't open $obj_dat_h : $!\n";