Commit d7676d03 authored by Paul Martin's avatar Paul Martin Committed by Tobias Frost

Import Debian changes 3.8.5-1

logrotate (3.8.5-1) unstable; urgency=low

  * New upstream release
    + Check for both possible orders of script output in tests.
      (Closes: #707526)
    + If logrotate state file is corrupted, fail with error.
    + Make logrotate state file creation atomic. (Closes: #707526)
    + Add fsync during log copytruncate and gzip+unlink.
    + Allow 'hourly' rotation.
    + Do not try to parse big (16+ MB) config files.
  * Debian patches merged upstream:
    - dst.patch
    - man-startcount.patch
    - man-compressext-576362.patch
    - asprintf-fixes.patch
    - makefile-test-cleanup.patch
    - manpage-hyphens.patch
    - acl-nosys-706050.patch
    - size-longlong-706460.patch
    - timetraveller-704950.patch
parents 4bee937d 03c92dcf
3.8.4 -> 3.8.5
- Improved rotation during daylight saving time and between timezone
changes.
- Fixed ACL setting problem caused by ext3 erroneously reporting ENOSYS
instead of ENOSUP.
- Do not continue with rotation if state file is corrupted.
- Make logrotate.status creation atomic.
- Allow "hourly" rotation. See manpage for more information.
- Use "/bin/echo" in tests. Fixes tests execution in Dash.
- Do no try to parse config files bigger than 16MB.
- Improved manpage consistency and formatting.
- Fix race condition between acl_set_fd() and fchmod().
3.8.3 -> 3.8.4
- Added --version command line option
- Disable ACL tests if logrotate is not compiled WITH_ACL support or if
ACLs are not supported by the system running tests
- Disable SELinux tests if logrotate is not compiled WITH_SELINUX support
or if SELinux is not supported by the system running tests
- Fixed bug which prevented skipping particular log file config
if the config contained errors.
- Fixed skipping of configs containing firstaction/lastaction scripts
with '}' character in case of error before these scripts.
- Support also 'K' unit for *size directives.
- Added preremove option to let admin to do something with the old logs
before they are removed by logrotate.
- Fixed possible loop in tabooext parsing.
- Move code to set SELinux context before compressLogFile calls to create
compressed log files with the proper context.
- Call prerotate/postrotate script only for really rotated files in
nosharedscripts mode (as stated in man page).
3.8.2 -> 3.8.3
- Fixed setting "size" bigger than 4GB on 32bit architectures
- Do not overwrite mode set by "create" option when using ACL. "create"
......
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code
2. Type `make' to compile the package.
3. Optionally, type `make test' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'.
If you want to add the Access Control List (ACL) support to the program
use `make WITH_ACL=yes' at the point 2 and `make test WITH_ACL=yes' at
the point 3.
If you want to add the NSA Security-Enhanced Linux (SELinux) support to
the program use `make WITH_SELINUX=yes' at the point 2.
If you want to add both the ACL and SELinux supports to the program use
`make WITH_ACL=yes WITH_SELINUX=yes' at the point 2 and
`make test WITH_ACL=yes' at the point 3.
......@@ -13,11 +13,21 @@ SVNTAG = r$(subst .,-,$(VERSION))
ifeq ($(WITH_SELINUX),yes)
CFLAGS += -DWITH_SELINUX
LOADLIBES += -lselinux
# See pretest
TEST_SELINUX=1
else
# See pretest
TEST_SELINUX=0
endif
ifeq ($(WITH_ACL),yes)
CFLAGS += -DWITH_ACL
LOADLIBES += -lacl
# See pretest
TEST_ACL=1
else
# See pretest
TEST_ACL=0
endif
# HP-UX using GCC
......@@ -104,16 +114,25 @@ endif
RCSVERSION = $(subst .,-,$(VERSION))
all: $(TARGET)
all: $(TARGET) pretest
$(PROG): $(OBJS)
clean:
rm -f $(OBJS) $(PROG) core* .depend
rm -f ./test/test.ACL ./test/test.SELINUX ./test/error.log
depend:
$(CPP) $(CFLAGS) -M $(SOURCES) > .depend
# pretest create the file ./test/test.ACL with
# 0 or 1 according to the WITH_ACL=yes presence.
# The file will be used by ./test/test to decide
# if to do the ACL tests or not.
pretest:
echo "$(TEST_ACL)" > ./test/test.ACL ;
echo "$(TEST_SELINUX)" > ./test/test.SELINUX ;
.PHONY : test
test: $(TARGET)
(cd test; ./test)
......
......@@ -45,7 +45,7 @@
#include "asprintf.c"
#endif
#if !defined(asprintf)
#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
#include <stdarg.h>
int asprintf(char **string_ptr, const char *format, ...)
......@@ -260,7 +260,9 @@ static int checkFile(const char *fname)
/* Check if fname is ending in a taboo-extension; if so, return false */
for (i = 0; i < tabooCount; i++) {
asprintf(&pattern, "*%s", tabooExts[i]);
if (asprintf(&pattern, "*%s", tabooExts[i]) < 0) {
message(MESS_FATAL, "failed to allocate taboo pattern memory\n");
}
if (!fnmatch(pattern, fname, 0))
{
free(pattern);
......@@ -309,6 +311,8 @@ static void copyLogInfo(struct logInfo *to, struct logInfo *from)
to->first = strdup(from->first);
if (from->last)
to->last = strdup(from->last);
if (from->preremove)
to->preremove = strdup(from->preremove);
if (from->logAddress)
to->logAddress = strdup(from->logAddress);
if (from->extension)
......@@ -343,6 +347,7 @@ static void freeLogInfo(struct logInfo *log)
free(log->post);
free(log->first);
free(log->last);
free(log->preremove);
free(log->logAddress);
free(log->extension);
free(log->compress_prog);
......@@ -381,7 +386,8 @@ static void freeTailLogs(int num)
message(MESS_DEBUG, "removing last %d log configs\n", num);
while (num--)
removeLogInfo(*(logs.tqh_last));
removeLogInfo(TAILQ_LAST(&logs, logInfoHead));
}
static int readConfigPath(const char *path, struct logInfo *defConfig)
......@@ -521,6 +527,7 @@ int readAllConfigPaths(const char **paths)
.post = NULL,
.first = NULL,
.last = NULL,
.preremove = NULL,
.logAddress = NULL,
.extension = NULL,
.compress_prog = NULL,
......@@ -624,12 +631,14 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
if ((flags = fcntl(fd, F_GETFD)) == -1) {
message(MESS_ERROR, "Could not retrieve flags from file %s\n",
configFile);
close(fd);
return 1;
}
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) == -1) {
message(MESS_ERROR, "Could not set flags on file %s\n",
configFile);
close(fd);
return 1;
}
/* We don't want anybody to change the file while we parse it,
......@@ -654,6 +663,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
if (!(pw = getpwuid(getuid()))) {
message(MESS_ERROR, "Logrotate UID is not in passwd file.\n");
close(fd);
return 1;
}
......@@ -687,6 +697,13 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
length = sb.st_size;
if (length > 0xffffff) {
message(MESS_ERROR, "file %s too large, probably not a config file.\n",
configFile);
close(fd);
return 1;
}
/* We can't mmap empty file... */
if (length == 0) {
message(MESS_DEBUG,
......@@ -915,7 +932,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
if ((key = isolateValue(configFile, lineNum, opt, &start,
&buf, length)) != NULL) {
int l = strlen(key) - 1;
if (key[l] == 'k') {
if (key[l] == 'k' || key[l] == 'K') {
key[l] = '\0';
multiplier = 1024;
} else if (key[l] == 'M') {
......@@ -938,7 +955,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
multiplier = 1;
}
size = multiplier * strtoul(key, &chptr, 0);
size = multiplier * strtoull(key, &chptr, 0);
if (*chptr) {
message(MESS_ERROR, "%s:%d bad size '%s'\n",
configFile, lineNum, key);
......@@ -976,6 +993,8 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
}
}
else continue;
} else if (!strcmp(key, "hourly")) {
newlog->criterium = ROT_HOURLY;
} else if (!strcmp(key, "daily")) {
newlog->criterium = ROT_DAYS;
newlog->threshhold = 1;
......@@ -1084,6 +1103,11 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
scriptStart = start;
scriptDest = &newlog->last;
state = STATE_LOAD_SCRIPT;
} else if (!strcmp(key, "preremove")) {
freeLogItem (preremove);
scriptStart = start;
scriptDest = &newlog->preremove;
state = STATE_LOAD_SCRIPT;
} else if (!strcmp(key, "tabooext")) {
if (newlog != defConfig) {
message(MESS_ERROR,
......@@ -1123,8 +1147,8 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
endtag = chptr;
if (*endtag == ',')
start++;
while (isspace(*endtag) && *endtag)
endtag++;
while (*endtag && isspace(*endtag))
endtag++;
}
}
......@@ -1439,12 +1463,8 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
newlog->pattern = key;
// if (!logerror)
// message(MESS_DEBUG, "reading config info for %s\n", start);
free(argv);
// start = endtag + 1;
} else if (*start == '}') {
if (newlog == defConfig) {
message(MESS_ERROR, "%s:%d unexpected }\n", configFile,
......@@ -1463,7 +1483,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
free(globerr_msg);
globerr_msg = NULL;
if (!(newlog->flags & LOG_FLAG_MISSINGOK))
return 1;
goto error;
}
if (newlog->oldDir) {
......@@ -1588,13 +1608,30 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
if (
(strcmp(key, "postrotate") == 0) ||
(strcmp(key, "prerotate") == 0) ||
(strcmp(key, "firstrotate") == 0) ||
(strcmp(key, "lastrotate") == 0)
(strcmp(key, "firstaction") == 0) ||
(strcmp(key, "lastaction") == 0) ||
(strcmp(key, "preremove") == 0)
) {
state = STATE_LOAD_SCRIPT | STATE_SKIP_CONFIG;
}
else {
state = STATE_SKIP_LINE | STATE_SKIP_CONFIG;
/* isolateWord moves the "start" pointer.
* If we have a line like
* rotate 5
* after isolateWord "start" points to "5" and it
* is OK to skip the line, but if we have a line
* like the following
* nocompress
* after isolateWord "start" points to "\n". In
* this case if we skip a line, we skip the next
* line, not the current "nocompress" one,
* because in the for cycle the "start"
* pointer is increased by one and, after this,
* "start" points to the beginning of the next line.
*/
if (*start != '\n') {
state = STATE_SKIP_LINE | STATE_SKIP_CONFIG;
}
}
free(key);
key = NULL;
......@@ -1613,7 +1650,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
if (scriptStart) {
message(MESS_ERROR,
"%s:prerotate or postrotate without endscript\n",
"%s:prerotate, postrotate or preremove without endscript\n",
configFile);
goto error;
}
......
logrotate (3.8.5-1) unstable; urgency=low
* New upstream release
+ Check for both possible orders of script output in tests.
(Closes: #707526)
+ If logrotate state file is corrupted, fail with error.
+ Make logrotate state file creation atomic. (Closes: #707526)
+ Add fsync during log copytruncate and gzip+unlink.
+ Allow 'hourly' rotation.
+ Do not try to parse big (16+ MB) config files.
* Debian patches merged upstream:
- dst.patch
- man-startcount.patch
- man-compressext-576362.patch
- asprintf-fixes.patch
- makefile-test-cleanup.patch
- manpage-hyphens.patch
- acl-nosys-706050.patch
- size-longlong-706460.patch
- timetraveller-704950.patch
-- Paul Martin <pm@debian.org> Wed, 26 Jun 2013 22:26:23 +0100
logrotate (3.8.3-5) unstable; urgency=low
* New patches:
......
ext3 filesystem without ACL support erroneously reports ENOSYS.
(Closes: #706050)
Index: logrotate-3.8.3/logrotate.c
===================================================================
--- logrotate-3.8.3.orig/logrotate.c 2013-04-24 14:21:15.987655119 +0100
+++ logrotate-3.8.3/logrotate.c 2013-04-24 14:25:53.397179115 +0100
@@ -35,6 +35,8 @@
#ifdef WITH_ACL
#include "sys/acl.h"
#define acl_type acl_t
+#define ACL_NOT_WELL_SUPPORTED(Err) \
+ ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
#else
#define acl_type void *
#endif
@@ -343,7 +345,7 @@
#ifdef WITH_ACL
if (!force_mode && acl) {
if (acl_set_fd(fd, acl) == -1) {
- if (errno != ENOTSUP) {
+ if (!ACL_NOT_WELL_SUPPORTED(errno)) {
message(MESS_ERROR, "setting ACL for %s: %s\n",
fileName, strerror(errno));
close(fd);
@@ -466,7 +468,7 @@
#ifdef WITH_ACL
if ((prev_acl = acl_get_fd(inFile)) == NULL) {
- if (errno != ENOTSUP) {
+ if (!ACL_NOT_WELL_SUPPORTED(errno)) {
message(MESS_ERROR, "getting file ACL %s: %s\n",
name, strerror(errno));
close(inFile);
@@ -677,7 +679,7 @@
#endif
#ifdef WITH_ACL
if ((prev_acl = acl_get_fd(fdcurr)) == NULL) {
- if (errno != ENOTSUP) {
+ if (!ACL_NOT_WELL_SUPPORTED(errno)) {
message(MESS_ERROR, "getting file ACL %s: %s\n",
currLog, strerror(errno));
close(fdcurr);
@@ -1362,7 +1364,7 @@
#endif
#ifdef WITH_ACL
if ((prev_acl = acl_get_file(log->files[logNum], ACL_TYPE_ACCESS)) == NULL) {
- if (errno != ENOTSUP) {
+ if (!ACL_NOT_WELL_SUPPORTED(errno)) {
message(MESS_ERROR, "getting file ACL %s: %s\n",
log->files[logNum], strerror(errno));
hasErrors = 1;
Description: Allow logrotate to build with hardening options.
Fix asprintf() return check warnings, don't override built in
asprintf() macro if we're building hardened.
Author: Paul Martin <pm@debian.org>
Index: logrotate-3.8.3/config.c
===================================================================
--- logrotate-3.8.3.orig/config.c 2013-04-24 13:57:16.942989964 +0100
+++ logrotate-3.8.3/config.c 2013-04-24 13:57:16.938989885 +0100
@@ -45,7 +45,7 @@
#include "asprintf.c"
#endif
-#if !defined(asprintf)
+#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
#include <stdarg.h>
int asprintf(char **string_ptr, const char *format, ...)
@@ -260,7 +260,9 @@
/* Check if fname is ending in a taboo-extension; if so, return false */
for (i = 0; i < tabooCount; i++) {
- asprintf(&pattern, "*%s", tabooExts[i]);
+ if (asprintf(&pattern, "*%s", tabooExts[i]) < 0) {
+ message(MESS_FATAL, "failed to allocate taboo pattern memory\n");
+ }
if (!fnmatch(pattern, fname, 0))
{
free(pattern);
Index: logrotate-3.8.3/logrotate.c
===================================================================
--- logrotate-3.8.3.orig/logrotate.c 2013-04-24 13:57:16.942989964 +0100
+++ logrotate-3.8.3/logrotate.c 2013-04-24 13:57:16.938989885 +0100
@@ -1033,14 +1033,16 @@
/* glob for uncompressed files with our pattern */
if (asprintf(&glob_pattern, "%s/%s%s%s", rotNames->dirName,
rotNames->baseName, dext_pattern, fileext) < 0) {
- message(MESS_ERROR, "could not allocate glob pattern memory\n");
+ message(MESS_FATAL, "could not allocate glob pattern memory\n");
}
rc = glob(glob_pattern, 0, globerr, &globResult);
if (!rc && globResult.gl_pathc > 0) {
for (i = 0; i < globResult.gl_pathc && !hasErrors; i++) {
struct stat sbprev;
- asprintf(&oldName, "%s", (globResult.gl_pathv)[i]);
+ if (asprintf(&oldName, "%s", (globResult.gl_pathv)[i]) < 0) {
+ message(MESS_FATAL, "could not allocate glob result memory\n");
+ }
if (stat(oldName, &sbprev)) {
message(MESS_DEBUG,
"previous log %s does not exist\n",
@@ -1054,16 +1056,20 @@
message(MESS_DEBUG,
"glob finding logs to compress failed\n");
/* fallback to old behaviour */
- asprintf(&oldName, "%s/%s.%d%s", rotNames->dirName,
- rotNames->baseName, logStart, fileext);
+ if (asprintf(&oldName, "%s/%s.%d%s", rotNames->dirName,
+ rotNames->baseName, logStart, fileext) < 0) {
+ message(MESS_FATAL, "could not allocate oldName memory\n");
+ }
free(oldName);
}
globfree(&globResult);
free(glob_pattern);
} else {
struct stat sbprev;
- asprintf(&oldName, "%s/%s.%d%s", rotNames->dirName,
- rotNames->baseName, logStart, fileext);
+ if (asprintf(&oldName, "%s/%s.%d%s", rotNames->dirName,
+ rotNames->baseName, logStart, fileext) < 0) {
+ message(MESS_FATAL, "could not allocate oldName memory\n");
+ }
if (stat(oldName, &sbprev)) {
message(MESS_DEBUG, "previous log %s does not exist\n",
oldName);
@@ -1121,7 +1127,9 @@
}
if (mail_out != -1) {
/* oldName is oldest Backup found (for unlink later) */
- asprintf(&oldName, "%s", (globResult.gl_pathv)[mail_out]);
+ if (asprintf(&oldName, "%s", (globResult.gl_pathv)[mail_out]) < 0) {
+ message(MESS_FATAL, "could not allocate mailout memory\n");
+ }
rotNames->disposeName = malloc(strlen(oldName)+1);
strcpy(rotNames->disposeName, oldName);
free(oldName);
@@ -1144,8 +1152,10 @@
if (log->rotateAge) {
struct stat fst_buf;
for (i = 1; i <= rotateCount + 1; i++) {
- asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName,
- rotNames->baseName, i, fileext, compext);
+ if (asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName,
+ rotNames->baseName, i, fileext, compext) < 0) {
+ message(MESS_FATAL, "could not allocate mailFilename memory\n");
+ }
if (!stat(oldName, &fst_buf)
&& (((nowSecs - fst_buf.st_mtime) / 60 / 60 / 24)
> log->rotateAge)) {
@@ -1161,9 +1171,11 @@
}
}
- asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName,
+ if (asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName,
rotNames->baseName, logStart + rotateCount, fileext,
- compext);
+ compext) < 0) {
+ message(MESS_FATAL, "could not allocate disposeName memory\n");
+ }
newName = strdup(oldName);
rotNames->disposeName = strdup(oldName);
@@ -1211,8 +1223,10 @@
for (i = rotateCount + logStart - 1; (i >= 0) && !hasErrors; i--) {
free(newName);
newName = oldName;
- asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName,
- rotNames->baseName, i, fileext, compext);
+ if (asprintf(&oldName, "%s/%s.%d%s%s", rotNames->dirName,
+ rotNames->baseName, i, fileext, compext) < 0) {
+ message(MESS_FATAL, "could not allocate oldName memory\n");
+ }
message(MESS_DEBUG,
"renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
@@ -1241,9 +1255,11 @@
if (asprintf(&(rotNames->finalName), "%s/%s%s%s", rotNames->dirName,
rotNames->baseName, dext_str, fileext) < 0) {
- message(MESS_ERROR, "could not allocate finalName memory\n");
+ message(MESS_FATAL, "could not allocate finalName memory\n");
+ }
+ if (asprintf(&destFile, "%s%s", rotNames->finalName, compext) < 0) {
+ message(MESS_FATAL, "could not allocate destFile memory\n");
}
- asprintf(&destFile, "%s%s", rotNames->finalName, compext);
if (!stat(destFile, &fst_buf)) {
message(MESS_DEBUG,
"destination %s already exists, skipping rotation\n",
@@ -1371,8 +1387,8 @@
strlen(log->files[logNum]) + 10);
sprintf(rotNames->disposeName, "%s%s", rotNames->finalName,
(log->compress_ext
- && (log->flags & LOG_FLAG_COMPRESS)) ? log->
- compress_ext : "");
+ && (log->flags & LOG_FLAG_COMPRESS)) ?
+ log->compress_ext : "");
message(MESS_DEBUG, "disposeName will be %s\n",
rotNames->disposeName);
}
Index: logrotate-3.8.3/logrotate.h
===================================================================
--- logrotate-3.8.3.orig/logrotate.h 2013-04-24 13:57:16.942989964 +0100
+++ logrotate-3.8.3/logrotate.h 2013-04-24 13:57:16.938989885 +0100
@@ -67,7 +67,7 @@
extern int debug;
int readAllConfigPaths(const char **paths);
-#if !defined(asprintf)
+#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
int asprintf(char **string_ptr, const char *format, ...);
#endif
Index: logrotate-3.8.3/logrotate.c
Index: logrotate-3.8.5/logrotate.c
===================================================================
--- logrotate-3.8.3.orig/logrotate.c 2013-04-24 13:57:07.998811871 +0100
+++ logrotate-3.8.3/logrotate.c 2013-04-24 13:57:07.990811715 +0100
@@ -311,8 +311,12 @@
--- logrotate-3.8.5.orig/logrotate.c 2013-06-26 22:17:20.821656206 +0100
+++ logrotate-3.8.5/logrotate.c 2013-06-26 22:17:20.817656132 +0100
@@ -314,8 +314,12 @@
if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) {
message(MESS_ERROR, "error setting mode of %s: %s\n",
fileName, strerror(errno));
......
......@@ -6,16 +6,16 @@ dpkg-cross sets CPP variable, and compilation failures, because
the executable 'cpp' does not accept multiple input files.
Index: logrotate-3.8.1/Makefile
Index: logrotate-3.8.5/Makefile
===================================================================
--- logrotate-3.8.1.orig/Makefile 2011-12-05 16:39:32.675492750 +0000
+++ logrotate-3.8.1/Makefile 2011-12-05 16:40:02.792331901 +0000
@@ -112,7 +112,7 @@
rm -f $(OBJS) $(PROG) core* .depend
--- logrotate-3.8.5.orig/Makefile 2013-06-26 22:15:57.859971822 +0100
+++ logrotate-3.8.5/Makefile 2013-06-26 22:15:57.855971737 +0100
@@ -123,7 +123,7 @@
rm -f ./test/test.ACL ./test/test.SELINUX ./test/error.log
depend:
- $(CPP) $(CFLAGS) -M $(SOURCES) > .depend
+ $(CC) -E $(CFLAGS) -M $(SOURCES) > .depend
.PHONY : test
test: $(TARGET)
# pretest create the file ./test/test.ACL with
# 0 or 1 according to the WITH_ACL=yes presence.
No longer consider state file dates before 1996 as fatal errors.
(Closes: #65534)
Index: logrotate-3.8.3/logrotate.c
Index: logrotate-3.8.5/logrotate.c
===================================================================
--- logrotate-3.8.3.orig/logrotate.c 2012-10-15 14:18:29.029722647 +0100
+++ logrotate-3.8.3/logrotate.c 2012-10-15 14:18:41.449959356 +0100
@@ -1832,7 +1832,7 @@
--- logrotate-3.8.5.orig/logrotate.c 2013-06-26 17:59:49.068795186 +0100
+++ logrotate-3.8.5/logrotate.c 2013-06-26 17:59:49.064795112 +0100
@@ -2035,7 +2035,7 @@
}
/* Hack to hide earlier bug */
......
Closes: #278591
Patch from: Holger Weiss <holger@ZEDAT.FU-Berlin.DE>
If you call logrotate once a week between 00:00 and 01:00 AM and
daylight saving time is in effect, "weekly" rotations will be done only
once in two weeks. E.g., the following crontab won't work as expected:
12 0 * * 1 /usr/sbin/logrotate
logrotate uses the tm struct "lastRotated" in order to find out whether
a logfile needs rotating. "lastRotated" is filled by first setting
everything to zero, then setting the mday, month and year of the last
rotation and then calling mktime(3) in order to normalize the rest of
the struct. The problem is that if daylight saving time is in effect,
mktime() will increment "lastRotated.tm_isdst" from 0 to 1 and push
"lastRotated" by one hour. Hence, the current time will be compared
with the day of the last rotation, 01:00 AM. This can be solved by
setting lastRotated.tm_isdst correctly prior to the mktime() call.
Index: logrotate-3.8.3/logrotate.c
===================================================================
--- logrotate-3.8.3.orig/logrotate.c 2012-10-15 14:18:41.449959356 +0100
+++ logrotate-3.8.3/logrotate.c 2012-10-15 14:18:56.842252799 +0100
@@ -241,6 +241,8 @@
new->lastRotated.tm_mon = now.tm_mon;
new->lastRotated.tm_mday = now.tm_mday;
new->lastRotated.tm_year = now.tm_year;
+ new->lastRotated.tm_hour = now.tm_hour;
+ new->lastRotated.tm_isdst = now.tm_isdst;
/* fill in the rest of the new->lastRotated fields */
lr_time = mktime(&new->lastRotated);
Index: logrotate-3.8.3/Makefile
===================================================================
--- logrotate-3.8.3.orig/Makefile 2013-04-24 13:06:32.258365269 +0100
+++ logrotate-3.8.3/Makefile 2013-04-24 13:16:56.538787185 +0100
@@ -120,7 +120,7 @@
clean:
rm -f $(OBJS) $(PROG) core* .depend
- rm -f ./test/test.ACL
+ rm -f ./test/test.ACL ./test/test.SELINUX ./test/error.log
depend:
$(CC) -E $(CFLAGS) -M $(SOURCES) > .depend
Index: logrotate-3.8.3/logrotate.8
===================================================================
--- logrotate-3.8.3.orig/logrotate.8 2012-10-15 14:18:49.334109659 +0100
+++ logrotate-3.8.3/logrotate.8 2012-10-15 14:24:55.709094697 +0100
@@ -185,6 +185,9 @@
Command line options may be passed to the compression program, if one is
in use. The default, for \fBgzip\fR(1), is "-6" (biased towards high
compression at the expense of speed).
+If you use a different compression command, you may need to change the
+\fBcompressoptions\fR to match.
+
.TP
\fBcopy\fR
Inconsistency in manpage logrotate(8), start directive
(Closes: #290628)
Index: logrotate-3.8.3/logrotate.8
===================================================================
--- logrotate-3.8.3.orig/logrotate.8 2012-10-15 14:18:45.750041327 +0100
+++ logrotate-3.8.3/logrotate.8 2012-10-15 14:18:49.334109659 +0100
@@ -481,7 +481,7 @@
you specify 0, the logs will be created with a .0 extension as they are
rotated from the original log files. If you specify 9, log files will
be created with a .9, skipping 0-8. Files will still be rotated the
-number of times specified with the \fBcount\fR directive.
+number of times specified with the \fBrotate\fR directive.
.TP
\fBsu \fIuser\fR \fIgroup\fR
Fix lintian warning "hyphen-used-as-minus-sign".
Standard groff sees bare "-" characters as hyphens. "\-" is needed for
groff to treat them as minux signs.
Index: logrotate-3.8.3/logrotate.8
===================================================================
--- logrotate-3.8.3.orig/logrotate.8 2012-10-15 14:24:55.709094697 +0100
+++ logrotate-3.8.3/logrotate.8 2012-10-16 13:30:23.235781259 +0100
@@ -1,9 +1,9 @@
.TH LOGROTATE 8 "Wed Nov 5 2002" "Linux" "System Administrator's Manual"
.SH NAME
-logrotate \- rotates, compresses, and mails system logs
+logrotate \(hy rotates, compresses, and mails system logs
.SH SYNOPSIS
-\fBlogrotate\fR [\fB-dv\fR] [\fB-f\fR|\fB--force\fR]
-[\fB-s\fR|\fB--state \fIfile\fR] \fIconfig_file\fR ..
+\fBlogrotate\fR [\fB\-dv\fR] [\fB\-f\fR|\fB\-\-force\fR]
+[\fB\-s\fR|\fB\-\-state \fIfile\fR] \fIconfig_file\fR ..
.SH DESCRIPTION
\fBlogrotate\fR is designed to ease administration of systems that generate
large numbers of log files. It allows automatic rotation, compression,
@@ -13,7 +13,7 @@
Normally, \fBlogrotate\fR is run as a daily cron job. It will not modify
a log more than once in one day unless the criterion for that log is
based on the log's size and \fBlogrotate\fR is being run more than once
-each day, or unless the \fB-f\fR or \fB--force\fR option is used.
+each day, or unless the \fB\-f\fR or \fB\-\-force\fR option is used.
.P
Any number of config files may be given on the command line. Later config
files may override the options given in earlier files, so the order
@@ -31,16 +31,16 @@
.SH OPTIONS
.TP
-\fB-?\fR, \fB-\-help\fR
+\fB\-?\fR, \fB\-\-help\fR
Prints help message.
.TP
-\fB-d\fR, \fB-\-debug\fR
+\fB\-d\fR, \fB\-\-debug\fR
Turns on debug mode and implies \fB-v\fR. In debug mode, no changes will
be made to the logs or to the \fBlogrotate\fR state file.
.TP
-\fB-f\fR, \fB-\-force\fR
+\fB\-f\fR, \fB\-\-force\fR
Tells \fBlogrotate\fR to force the rotation, even if it doesn't think
this is necessary. Sometimes this is useful after adding new entries to
a \fBlogrotate\fR config file, or if old log files have been removed
@@ -48,7 +48,7 @@