summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-01-02 03:29:45 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-06 11:13:57 +0000
commit907c8ce6250752fe06476e037b99a6ac88b8500d (patch)
tree92b99fd0b527fe61444199c982d7a947fc2ee043 /meta/recipes-extended/logrotate
parent63281708fab30adc4ca1a506deefbf8a54dcce6d (diff)
downloadpoky-907c8ce6250752fe06476e037b99a6ac88b8500d.tar.gz
logrotate: upgrade to 3.8.7
* Upgrade to 3.8.7 * Rename the patches dir from logrotate-3.8.1 -> logrotate * Remove grotate-CVE-2011-1548.patch since it had been fixed * Update act-as-mv-when-rotate.patch and update-the-manual.patch to make them work with the higher version, and send them to the upstream * Fix the HOMEPAGE (From OE-Core rev: e15d7955a98cfd6923775cdb3aa61756d4f58c2d) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.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/act-as-mv-when-rotate.patch (renamed from meta/recipes-extended/logrotate/logrotate-3.8.1/act-as-mv-when-rotate.patch)53
-rw-r--r--meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch (renamed from meta/recipes-extended/logrotate/logrotate-3.8.1/disable-check-different-filesystems.patch)2
-rw-r--r--meta/recipes-extended/logrotate/logrotate/logrotate-CVE-2011-1548.patch (renamed from meta/recipes-extended/logrotate/logrotate-3.8.1/logrotate-CVE-2011-1548.patch)0
-rw-r--r--meta/recipes-extended/logrotate/logrotate/update-the-manual.patch (renamed from meta/recipes-extended/logrotate/logrotate-3.8.1/update-the-manual.patch)18
-rw-r--r--meta/recipes-extended/logrotate/logrotate_3.8.7.bb (renamed from meta/recipes-extended/logrotate/logrotate_3.8.1.bb)8
5 files changed, 48 insertions, 33 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate-3.8.1/act-as-mv-when-rotate.patch b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
index c9fb1d2525..ce64040d5f 100644
--- a/meta/recipes-extended/logrotate/logrotate-3.8.1/act-as-mv-when-rotate.patch
+++ b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -3,18 +3,18 @@ Act as the "mv" command when rotate log
3Act as the "mv" command when rotate log, first rename, if failed, then 3Act as the "mv" command when rotate log, first rename, if failed, then
4read and write. 4read and write.
5 5
6Upstream-Status: Pending 6Upstream-Status: Submitted
7 7
8Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 8Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
9--- 9---
10 logrotate.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------ 10 logrotate.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
11 1 files changed, 53 insertions(+), 6 deletions(-) 11 1 file changed, 56 insertions(+), 9 deletions(-)
12 12
13diff --git a/logrotate.c b/logrotate.c 13diff --git a/logrotate.c b/logrotate.c
14index 537e8d6..b04482f 100644 14index 174a26b..b18b629 100644
15--- a/logrotate.c 15--- a/logrotate.c
16+++ b/logrotate.c 16+++ b/logrotate.c
17@@ -808,6 +808,53 @@ int findNeedRotating(struct logInfo *log, int logNum) 17@@ -906,6 +906,53 @@ int findNeedRotating(struct logInfo *log, int logNum, int force)
18 return 0; 18 return 0;
19 } 19 }
20 20
@@ -23,7 +23,7 @@ index 537e8d6..b04482f 100644
23+ * the strerror(errorno) to handle the error message, so we don't have 23+ * the strerror(errorno) to handle the error message, so we don't have
24+ * to print the error message here */ 24+ * to print the error message here */
25+ 25+
26+int mvFile (char *oldName, char *newName, struct logInfo *log) 26+int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl)
27+{ 27+{
28+ struct stat sbprev; 28+ struct stat sbprev;
29+ int fd_old, fd_new, n; 29+ int fd_old, fd_new, n;
@@ -45,7 +45,7 @@ index 537e8d6..b04482f 100644
45+ return 1; 45+ return 1;
46+ else { 46+ else {
47+ if ((fd_new = createOutputFile(newName, 47+ if ((fd_new = createOutputFile(newName,
48+ O_WRONLY | O_CREAT | O_TRUNC, &sbprev)) < 0 ) 48+ O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 )
49+ return 1; 49+ return 1;
50+ } 50+ }
51+ 51+
@@ -68,8 +68,8 @@ index 537e8d6..b04482f 100644
68 int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state, 68 int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
69 struct logNames *rotNames) 69 struct logNames *rotNames)
70 { 70 {
71@@ -1148,15 +1195,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state, 71@@ -1268,15 +1315,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
72 rotNames->baseName, i, fileext, compext); 72 }
73 73
74 message(MESS_DEBUG, 74 message(MESS_DEBUG,
75- "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n", 75- "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
@@ -77,7 +77,7 @@ index 537e8d6..b04482f 100644
77 oldName, newName, rotateCount, logStart, i); 77 oldName, newName, rotateCount, logStart, i);
78 78
79- if (!debug && rename(oldName, newName)) { 79- if (!debug && rename(oldName, newName)) {
80+ if (!debug && mvFile(oldName, newName, log)) { 80+ if (!debug && mvFile(oldName, newName, log, prev_acl)) {
81 if (errno == ENOENT) { 81 if (errno == ENOENT) {
82 message(MESS_DEBUG, "old log %s does not exist\n", 82 message(MESS_DEBUG, "old log %s does not exist\n",
83 oldName); 83 oldName);
@@ -87,7 +87,7 @@ index 537e8d6..b04482f 100644
87 oldName, newName, strerror(errno)); 87 oldName, newName, strerror(errno));
88 hasErrors = 1; 88 hasErrors = 1;
89 } 89 }
90@@ -1286,11 +1333,11 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state, 90@@ -1408,11 +1455,11 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
91 } 91 }
92 } 92 }
93 #endif /* WITH_ACL */ 93 #endif /* WITH_ACL */
@@ -97,11 +97,38 @@ index 537e8d6..b04482f 100644
97 if (!debug && !hasErrors && 97 if (!debug && !hasErrors &&
98- rename(log->files[logNum], rotNames->finalName)) { 98- rename(log->files[logNum], rotNames->finalName)) {
99- message(MESS_ERROR, "failed to rename %s to %s: %s\n", 99- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
100+ mvFile(log->files[logNum], rotNames->finalName, log)) { 100+ mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
101+ message(MESS_ERROR, "failed to move %s to %s: %s\n", 101+ message(MESS_ERROR, "failed to move %s to %s: %s\n",
102 log->files[logNum], rotNames->finalName, 102 log->files[logNum], rotNames->finalName,
103 strerror(errno)); 103 strerror(errno));
104 hasErrors = 1; 104 hasErrors = 1;
105@@ -1775,7 +1822,7 @@ int rotateLogSet(struct logInfo *log, int force)
106 return hasErrors;
107 }
108
109-static int writeState(char *stateFilename)
110+static int writeState(struct logInfo *log, char *stateFilename)
111 {
112 struct logState *p;
113 FILE *f;
114@@ -1939,7 +1986,7 @@ static int writeState(char *stateFilename)
115 fclose(f);
116
117 if (error == 0) {
118- if (rename(tmpFilename, stateFilename)) {
119+ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
120 unlink(tmpFilename);
121 error = 1;
122 message(MESS_ERROR, "error renaming temp state file %s\n",
123@@ -2223,7 +2270,7 @@ int main(int argc, const char **argv)
124 rc |= rotateLogSet(log, force);
125
126 if (!debug)
127- rc |= writeState(stateFile);
128+ rc |= writeState(log, stateFile);
129
130 return (rc != 0);
131 }
105-- 132--
1061.7.4.1 1331.7.10.4
107 134
diff --git a/meta/recipes-extended/logrotate/logrotate-3.8.1/disable-check-different-filesystems.patch b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
index 5cb6038404..43068bdbd7 100644
--- a/meta/recipes-extended/logrotate/logrotate-3.8.1/disable-check-different-filesystems.patch
+++ b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
@@ -3,7 +3,7 @@ Disable the check for different filesystems
3The logrotate supports rotate log across different filesystems now, so 3The logrotate supports rotate log across different filesystems now, so
4disable the check for different filesystems. 4disable the check for different filesystems.
5 5
6Upstream-Status: Pending 6Upstream-Status: Submitted
7 7
8Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 8Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
9--- 9---
diff --git a/meta/recipes-extended/logrotate/logrotate-3.8.1/logrotate-CVE-2011-1548.patch b/meta/recipes-extended/logrotate/logrotate/logrotate-CVE-2011-1548.patch
index ed2750e9c3..ed2750e9c3 100644
--- a/meta/recipes-extended/logrotate/logrotate-3.8.1/logrotate-CVE-2011-1548.patch
+++ b/meta/recipes-extended/logrotate/logrotate/logrotate-CVE-2011-1548.patch
diff --git a/meta/recipes-extended/logrotate/logrotate-3.8.1/update-the-manual.patch b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
index 5cab64947b..517acdd27e 100644
--- a/meta/recipes-extended/logrotate/logrotate-3.8.1/update-the-manual.patch
+++ b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
@@ -1,14 +1,13 @@
1Update the manual 1Update the manual
2 2
3* Update the mannual 3Update the manual for rotating on different filesystems.
4* Fix a bug in the mannual(\f should be \fR)
5 4
6Upstream-Status: Pending 5Upstream-Status: Submitted
7 6
8Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 7Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
9--- 8---
10 logrotate.8 | 9 ++++----- 9 logrotate.8 | 7 +++----
11 1 files changed, 4 insertions(+), 5 deletions(-) 10 1 files changed, 3 insertions(+), 4 deletions(-)
12 11
13diff --git a/logrotate.8 b/logrotate.8 12diff --git a/logrotate.8 b/logrotate.8
14index 8b34167..5f15432 100644 13index 8b34167..5f15432 100644
@@ -28,15 +27,6 @@ index 8b34167..5f15432 100644
28 overridden by the \fBnoolddir\fR option. 27 overridden by the \fBnoolddir\fR option.
29 28
30 .TP 29 .TP
31@@ -435,7 +434,7 @@ Log files are rotated only if they grow bigger then \fIsize\fR bytes. If
32 \fIsize\fR is followed by \fIk\fR, the size is assumed to be in kilobytes.
33 If the \fIM\fR is used, the size is in megabytes, and if \fIG\fR is used, the
34 size is in gigabytes. So \fBsize 100\fR, \fIsize 100k\fR, \fIsize 100M\fR and
35-\fIsize 100G\f are all valid.
36+\fIsize 100G\fR are all valid.
37
38 .TP
39 \fBsharedscripts\fR
40-- 30--
411.7.4.1 311.7.4.1
42 32
diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.1.bb b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
index b12a32577b..055bfd565d 100644
--- a/meta/recipes-extended/logrotate/logrotate_3.8.1.bb
+++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
@@ -1,6 +1,6 @@
1SUMMARY = "Rotates, compresses, removes and mails system log files" 1SUMMARY = "Rotates, compresses, removes and mails system log files"
2SECTION = "console/utils" 2SECTION = "console/utils"
3HOMEPAGE = "https://fedorahosted.org/releases/l/o/logrotate" 3HOMEPAGE = "https://fedorahosted.org/logrotate/"
4LICENSE = "GPLv2" 4LICENSE = "GPLv2"
5 5
6DEPENDS="coreutils popt" 6DEPENDS="coreutils popt"
@@ -11,12 +11,10 @@ SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
11 file://act-as-mv-when-rotate.patch \ 11 file://act-as-mv-when-rotate.patch \
12 file://disable-check-different-filesystems.patch \ 12 file://disable-check-different-filesystems.patch \
13 file://update-the-manual.patch \ 13 file://update-the-manual.patch \
14 file://logrotate-CVE-2011-1548.patch \
15 " 14 "
16 15
17SRC_URI[md5sum] = "bd2e20d8dc644291b08f9215397d28a5" 16SRC_URI[md5sum] = "99e08503ef24c3e2e3ff74cc5f3be213"
18SRC_URI[sha256sum] = "c12471e70ae8bc923bd5c4f25e8fd6483b68c6301f3cd79f7cfe37bc5b370169" 17SRC_URI[sha256sum] = "f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64"
19
20 18
21EXTRA_OEMAKE = "CC='${CC}'" 19EXTRA_OEMAKE = "CC='${CC}'"
22 20