aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch
diff options
context:
space:
mode:
authorZhenbo Gao <zhenbo.gao@windriver.com>2017-06-05 15:38:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-06 19:49:56 +0100
commitae87a0967d687cf9e308b22b35facb0b38a9141a (patch)
tree0e72716f24b6dfeac8d10ec169aec34da28ef12c /meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch
parentae78eac950e209da430ca0d258656f616a2ef9d2 (diff)
downloadopenembedded-core-contrib-ae87a0967d687cf9e308b22b35facb0b38a9141a.tar.gz
logrotate: Support system dates back to the year 1970
backport commit bdbfea3 from logrotate upstream. Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch')
-rw-r--r--meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch b/meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch
new file mode 100644
index 0000000000..b544ec6661
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch
@@ -0,0 +1,27 @@
+Support system dates back to the year 1970
+
+The system time on Linux can be set back as far as 1970 (the epoch time).
+Currently logrotate stops working correctly if the time goes before 1996.
+This value (1996) appears to have been hard coded since the code was written
+back in 1996. Testing and code analysis shows this can simply be modified
+to 1970.
+
+The patch is provided by Matt Bennett <matt.bennett@alliedtelesis.co.nz>
+
+Upstream-Status: Backport +
+Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
+
+diff --git a/logrotate.c.orig b/logrotate.c
+index cf8bf2c..a7dadfb 100644
+--- a/logrotate.c.orig
++++ b/logrotate.c
+@@ -2381,7 +2381,7 @@ static int readState(char *stateFilename)
+ }
+
+ /* Hack to hide earlier bug */
+- if ((year != 1900) && (year < 1996 || year > 2100)) {
++ if ((year != 1900) && (year < 1970 || year > 2100)) {
+ message(MESS_ERROR,
+ "bad year %d for file %s in state file %s\n", year,
+ argv[0], stateFilename);
+