aboutsummaryrefslogtreecommitdiffstats
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:12:30 +0000
commite15d7955a98cfd6923775cdb3aa61756d4f58c2d (patch)
treeca93a5f5016bd3a9496415d9eb7588ac44bc16a5 /meta/recipes-extended/logrotate
parent82cc941128f9eaf57c3a9a648fc58227f6c1956c (diff)
downloadopenembedded-core-contrib-e15d7955a98cfd6923775cdb3aa61756d4f58c2d.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 Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
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
Act as the "mv" command when rotate log, first rename, if failed, then
read and write.
-Upstream-Status: Pending
+Upstream-Status: Submitted
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
- logrotate.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
- 1 files changed, 53 insertions(+), 6 deletions(-)
+ logrotate.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 56 insertions(+), 9 deletions(-)
diff --git a/logrotate.c b/logrotate.c
-index 537e8d6..b04482f 100644
+index 174a26b..b18b629 100644
--- a/logrotate.c
+++ b/logrotate.c
-@@ -808,6 +808,53 @@ int findNeedRotating(struct logInfo *log, int logNum)
+@@ -906,6 +906,53 @@ int findNeedRotating(struct logInfo *log, int logNum, int force)
return 0;
}
@@ -23,7 +23,7 @@ index 537e8d6..b04482f 100644
+ * the strerror(errorno) to handle the error message, so we don't have
+ * to print the error message here */
+
-+int mvFile (char *oldName, char *newName, struct logInfo *log)
++int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl)
+{
+ struct stat sbprev;
+ int fd_old, fd_new, n;
@@ -45,7 +45,7 @@ index 537e8d6..b04482f 100644
+ return 1;
+ else {
+ if ((fd_new = createOutputFile(newName,
-+ O_WRONLY | O_CREAT | O_TRUNC, &sbprev)) < 0 )
++ O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 )
+ return 1;
+ }
+
@@ -68,8 +68,8 @@ index 537e8d6..b04482f 100644
int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
struct logNames *rotNames)
{
-@@ -1148,15 +1195,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
- rotNames->baseName, i, fileext, compext);
+@@ -1268,15 +1315,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ }
message(MESS_DEBUG,
- "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
@@ -77,7 +77,7 @@ index 537e8d6..b04482f 100644
oldName, newName, rotateCount, logStart, i);
- if (!debug && rename(oldName, newName)) {
-+ if (!debug && mvFile(oldName, newName, log)) {
++ if (!debug && mvFile(oldName, newName, log, prev_acl)) {
if (errno == ENOENT) {
message(MESS_DEBUG, "old log %s does not exist\n",
oldName);
@@ -87,7 +87,7 @@ index 537e8d6..b04482f 100644
oldName, newName, strerror(errno));
hasErrors = 1;
}
-@@ -1286,11 +1333,11 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+@@ -1408,11 +1455,11 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
}
}
#endif /* WITH_ACL */
@@ -97,11 +97,38 @@ index 537e8d6..b04482f 100644
if (!debug && !hasErrors &&
- rename(log->files[logNum], rotNames->finalName)) {
- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
-+ mvFile(log->files[logNum], rotNames->finalName, log)) {
++ mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
+ message(MESS_ERROR, "failed to move %s to %s: %s\n",
log->files[logNum], rotNames->finalName,
strerror(errno));
hasErrors = 1;
+@@ -1775,7 +1822,7 @@ int rotateLogSet(struct logInfo *log, int force)
+ return hasErrors;
+ }
+
+-static int writeState(char *stateFilename)
++static int writeState(struct logInfo *log, char *stateFilename)
+ {
+ struct logState *p;
+ FILE *f;
+@@ -1939,7 +1986,7 @@ static int writeState(char *stateFilename)
+ fclose(f);
+
+ if (error == 0) {
+- if (rename(tmpFilename, stateFilename)) {
++ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
+ unlink(tmpFilename);
+ error = 1;
+ message(MESS_ERROR, "error renaming temp state file %s\n",
+@@ -2223,7 +2270,7 @@ int main(int argc, const char **argv)
+ rc |= rotateLogSet(log, force);
+
+ if (!debug)
+- rc |= writeState(stateFile);
++ rc |= writeState(log, stateFile);
+
+ return (rc != 0);
+ }
--
-1.7.4.1
+1.7.10.4
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
The logrotate supports rotate log across different filesystems now, so
disable the check for different filesystems.
-Upstream-Status: Pending
+Upstream-Status: Submitted
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
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 @@
Update the manual
-* Update the mannual
-* Fix a bug in the mannual(\f should be \fR)
+Update the manual for rotating on different filesystems.
-Upstream-Status: Pending
+Upstream-Status: Submitted
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
- logrotate.8 | 9 ++++-----
- 1 files changed, 4 insertions(+), 5 deletions(-)
+ logrotate.8 | 7 +++----
+ 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/logrotate.8 b/logrotate.8
index 8b34167..5f15432 100644
@@ -28,15 +27,6 @@ index 8b34167..5f15432 100644
overridden by the \fBnoolddir\fR option.
.TP
-@@ -435,7 +434,7 @@ Log files are rotated only if they grow bigger then \fIsize\fR bytes. If
- \fIsize\fR is followed by \fIk\fR, the size is assumed to be in kilobytes.
- If the \fIM\fR is used, the size is in megabytes, and if \fIG\fR is used, the
- size is in gigabytes. So \fBsize 100\fR, \fIsize 100k\fR, \fIsize 100M\fR and
--\fIsize 100G\f are all valid.
-+\fIsize 100G\fR are all valid.
-
- .TP
- \fBsharedscripts\fR
--
1.7.4.1
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 @@
SUMMARY = "Rotates, compresses, removes and mails system log files"
SECTION = "console/utils"
-HOMEPAGE = "https://fedorahosted.org/releases/l/o/logrotate"
+HOMEPAGE = "https://fedorahosted.org/logrotate/"
LICENSE = "GPLv2"
DEPENDS="coreutils popt"
@@ -11,12 +11,10 @@ SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
file://act-as-mv-when-rotate.patch \
file://disable-check-different-filesystems.patch \
file://update-the-manual.patch \
- file://logrotate-CVE-2011-1548.patch \
"
-SRC_URI[md5sum] = "bd2e20d8dc644291b08f9215397d28a5"
-SRC_URI[sha256sum] = "c12471e70ae8bc923bd5c4f25e8fd6483b68c6301f3cd79f7cfe37bc5b370169"
-
+SRC_URI[md5sum] = "99e08503ef24c3e2e3ff74cc5f3be213"
+SRC_URI[sha256sum] = "f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64"
EXTRA_OEMAKE = "CC='${CC}'"
('=') keys.append(key) values.append(value) parm = dict(zip(keys,values)) path = "//" + path.split(';')[0] host += ":%s" % (port) parm["cset"] = Perforce.getcset(d, path, host, user, pswd, parm) return host,path,user,pswd,parm doparse = staticmethod(doparse) def getcset(d, depot,host,user,pswd,parm): p4opt = "" if "cset" in parm: return parm["cset"]; if user: p4opt += " -u %s" % (user) if pswd: p4opt += " -P %s" % (pswd) if host: p4opt += " -p %s" % (host) p4date = data.getVar("P4DATE", d, 1) if "revision" in parm: depot += "#%s" % (parm["revision"]) elif "label" in parm: depot += "@%s" % (parm["label"]) elif p4date: depot += "@%s" % (p4date) p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1) bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s%s changes -m 1 %s" % (p4cmd, p4opt, depot)) p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot)) cset = p4file.readline().strip() bb.msg.debug(1, bb.msg.domain.Fetcher, "READ %s" % (cset)) if not cset: return -1 return cset.split(' ')[1] getcset = staticmethod(getcset) def localpath(self, url, ud, d): (host,path,user,pswd,parm) = Perforce.doparse(url,d) # If a label is specified, we use that as our filename if "label" in parm: ud.localfile = "%s.tar.gz" % (parm["label"]) return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile) base = path which = path.find('/...') if which != -1: base = path[:which] if base[0] == "/": base = base[1:] cset = Perforce.getcset(d, path, host, user, pswd, parm) ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host,base.replace('/', '.'), cset), d) return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile) def go(self, loc, ud, d): """ Fetch urls """ (host,depot,user,pswd,parm) = Perforce.doparse(loc, d) if depot.find('/...') != -1: path = depot[:depot.find('/...')] else: path = depot if "module" in parm: module = parm["module"] else: module = os.path.basename(path) localdata = data.createCopy(d) data.setVar('OVERRIDES', "p4:%s" % data.getVar('OVERRIDES', localdata), localdata) data.update_data(localdata) # Get the p4 command p4opt = "" if user: p4opt += " -u %s" % (user) if pswd: p4opt += " -P %s" % (pswd) if host: p4opt += " -p %s" % (host) p4cmd = data.getVar('FETCHCOMMAND', localdata, 1) # create temp directory bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: creating temporary directory") bb.mkdirhier(data.expand('${WORKDIR}', localdata)) data.setVar('TMPBASE', data.expand('${WORKDIR}/oep4.XXXXXX', localdata), localdata) tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false") tmpfile = tmppipe.readline().strip() if not tmpfile: bb.error("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.") raise FetchError(module) if "label" in parm: depot = "%s@%s" % (depot,parm["label"]) else: cset = Perforce.getcset(d, depot, host, user, pswd, parm) depot = "%s@%s" % (depot,cset) os.chdir(tmpfile) bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc) bb.msg.note(1, bb.msg.domain.Fetcher, "%s%s files %s" % (p4cmd, p4opt, depot)) p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot)) if not p4file: bb.error("Fetch: unable to get the P4 files from %s" % (depot)) raise FetchError(module) count = 0 for file in p4file: list = file.split() if list[2] == "delete": continue dest = list[0][len(path)+1:] where = dest.find("#") os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module,dest[:where],list[0])) count = count + 1 if count == 0: bb.error("Fetch: No files gathered from the P4 fetch") raise FetchError(module) myret = os.system("tar -czf %s %s" % (ud.localpath, module)) if myret != 0: try: os.unlink(ud.localpath) except OSError: pass raise FetchError(module) # cleanup os.system('rm -rf %s' % tmpfile)