diff options
author | Zhenbo Gao <zhenbo.gao@windriver.com> | 2017-06-05 15:38:04 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-06 19:52:26 +0100 |
commit | 5dd94a5dc49465f59733e333d28eaa0bed91cbfd (patch) | |
tree | 329bb08660c5d7dcf94d5faec0d8a81faf32354b /meta/recipes-extended/logrotate | |
parent | 27a40d6d5231a0531e30feabe63b92151dbe251b (diff) | |
download | poky-5dd94a5dc49465f59733e333d28eaa0bed91cbfd.tar.gz |
logrotate: Support system dates back to the year 1970
backport commit bdbfea3 from logrotate upstream.
(From OE-Core rev: ae87a0967d687cf9e308b22b35facb0b38a9141a)
Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/logrotate')
-rw-r--r-- | meta/recipes-extended/logrotate/logrotate/0001-Support-system-dates-back-to-the-year-1970.patch | 27 | ||||
-rw-r--r-- | meta/recipes-extended/logrotate/logrotate_3.9.1.bb | 1 |
2 files changed, 28 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 @@ | |||
1 | Support system dates back to the year 1970 | ||
2 | |||
3 | The system time on Linux can be set back as far as 1970 (the epoch time). | ||
4 | Currently logrotate stops working correctly if the time goes before 1996. | ||
5 | This value (1996) appears to have been hard coded since the code was written | ||
6 | back in 1996. Testing and code analysis shows this can simply be modified | ||
7 | to 1970. | ||
8 | |||
9 | The patch is provided by Matt Bennett <matt.bennett@alliedtelesis.co.nz> | ||
10 | |||
11 | Upstream-Status: Backport + | ||
12 | Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com> | ||
13 | |||
14 | diff --git a/logrotate.c.orig b/logrotate.c | ||
15 | index cf8bf2c..a7dadfb 100644 | ||
16 | --- a/logrotate.c.orig | ||
17 | +++ b/logrotate.c | ||
18 | @@ -2381,7 +2381,7 @@ static int readState(char *stateFilename) | ||
19 | } | ||
20 | |||
21 | /* Hack to hide earlier bug */ | ||
22 | - if ((year != 1900) && (year < 1996 || year > 2100)) { | ||
23 | + if ((year != 1900) && (year < 1970 || year > 2100)) { | ||
24 | message(MESS_ERROR, | ||
25 | "bad year %d for file %s in state file %s\n", year, | ||
26 | argv[0], stateFilename); | ||
27 | |||
diff --git a/meta/recipes-extended/logrotate/logrotate_3.9.1.bb b/meta/recipes-extended/logrotate/logrotate_3.9.1.bb index c938d9f65e..4246231199 100644 --- a/meta/recipes-extended/logrotate/logrotate_3.9.1.bb +++ b/meta/recipes-extended/logrotate/logrotate_3.9.1.bb | |||
@@ -23,6 +23,7 @@ SRC_URI = "https://github.com/${BPN}/${BPN}/archive/r3-9-1.tar.gz \ | |||
23 | file://act-as-mv-when-rotate.patch \ | 23 | file://act-as-mv-when-rotate.patch \ |
24 | file://update-the-manual.patch \ | 24 | file://update-the-manual.patch \ |
25 | file://disable-check-different-filesystems.patch \ | 25 | file://disable-check-different-filesystems.patch \ |
26 | file://0001-Support-system-dates-back-to-the-year-1970.patch \ | ||
26 | " | 27 | " |
27 | 28 | ||
28 | SRC_URI[md5sum] = "8572b7c2cf9ade09a8a8e10098500fb3" | 29 | SRC_URI[md5sum] = "8572b7c2cf9ade09a8a8e10098500fb3" |