Hello community, here is the log from the commit of package logrotate for openSUSE:Factory checked in at 2013-11-12 09:50:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/logrotate (Old) and /work/SRC/openSUSE:Factory/.logrotate.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "logrotate" Changes: -------- --- /work/SRC/openSUSE:Factory/logrotate/logrotate.changes 2013-08-24 10:14:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.logrotate.new/logrotate.changes 2013-11-12 09:50:41.000000000 +0100 @@ -1,0 +2,14 @@ +Thu Nov 7 20:26:51 UTC 2013 - [email protected] + +- update to 3.8.7, fix bnc#849436 +- Changelog 3.8.7: + * Fixed --force/-f option handling together with "size" directive + (3.8.5 regression). + * Use "logrotate_tmp_t" context for SELinux tests and if this + context does not exist, skip SELinux related tests. +- Changelog 3.8.6 + * Fixed memory corruption caused by rotation directory which + does not exist with "sharedscripts" together with "prerotate" + script. + +------------------------------------------------------------------- Old: ---- logrotate-3.8.5.tar.gz New: ---- logrotate-3.8.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ logrotate.spec ++++++ --- /var/tmp/diff_new_pack.sStQrz/_old 2013-11-12 09:50:42.000000000 +0100 +++ /var/tmp/diff_new_pack.sStQrz/_new 2013-11-12 09:50:42.000000000 +0100 @@ -19,7 +19,7 @@ Url: https://fedorahosted.org/releases/l/o/logrotate Name: logrotate -Version: 3.8.5 +Version: 3.8.7 Release: 0 Summary: Rotate, compress, remove, and mail system log files License: GPL-2.0+ ++++++ logrotate-3.7.8-addextension.patch ++++++ --- /var/tmp/diff_new_pack.sStQrz/_old 2013-11-12 09:50:42.000000000 +0100 +++ /var/tmp/diff_new_pack.sStQrz/_new 2013-11-12 09:50:42.000000000 +0100 @@ -1,10 +1,10 @@ Index: test/test =================================================================== ---- test/test.orig 2013-07-25 14:13:04.195582354 +0200 -+++ test/test 2013-07-25 14:14:27.468464841 +0200 -@@ -1285,6 +1285,28 @@ echo "Does not have GNU Date, skipping p - fi - +--- test/test.orig 2013-10-10 10:43:36.000000000 +0200 ++++ test/test 2013-11-07 21:46:37.112487860 +0100 +@@ -1358,4 +1358,27 @@ + test.log.1 0 zero + EOF +# check rotation with extension appended to the filename +cleanup 100 @@ -28,8 +28,7 @@ +test.1.log 0 zero +EOF + - - ++ cleanup Index: config.c =================================================================== ++++++ logrotate-3.8.5.tar.gz -> logrotate-3.8.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/CHANGES new/logrotate-3.8.7/CHANGES --- old/logrotate-3.8.5/CHANGES 2013-06-10 14:02:36.000000000 +0200 +++ new/logrotate-3.8.7/CHANGES 2013-10-10 10:43:36.000000000 +0200 @@ -1,3 +1,13 @@ +3.8.6 -> 3.8.7 + - Fixed --force/-f option handling together with "size" directive + (3.8.5 regression). + - Use "logrotate_tmp_t" context for SELinux tests and if this context does + not exist, skip SELinux related tests. + +3.8.5 -> 3.8.6 + - Fixed memory corruption caused by rotation directory which does not + exist with "sharedscripts" together with "prerotate" script. + 3.8.4 -> 3.8.5 - Improved rotation during daylight saving time and between timezone changes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/config.c new/logrotate-3.8.7/config.c --- old/logrotate-3.8.5/config.c 2013-06-10 14:02:36.000000000 +0200 +++ new/logrotate-3.8.7/config.c 2013-07-31 13:34:31.000000000 +0200 @@ -812,7 +812,7 @@ if (key == NULL) continue; - rc = sscanf(key, "%200s %200s%c", createOwner, + rc = sscanf(key, "%199s %199s%c", createOwner, createGroup, &foo); if (rc == 3) { message(MESS_ERROR, "%s:%d extra arguments for " @@ -863,11 +863,11 @@ if (key == NULL) continue; - rc = sscanf(key, "%o %200s %200s%c", &createMode, + rc = sscanf(key, "%o %199s %199s%c", &createMode, createOwner, createGroup, &foo); /* We support 'create <owner> <group> notation now */ if (rc == 0) { - rc = sscanf(key, "%200s %200s%c", + rc = sscanf(key, "%199s %199s%c", createOwner, createGroup, &foo); /* Simulate that we have read createMode and se it * to NO_MODE. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/logrotate.c new/logrotate-3.8.7/logrotate.c --- old/logrotate-3.8.5/logrotate.c 2013-06-10 14:02:36.000000000 +0200 +++ new/logrotate-3.8.7/logrotate.c 2013-10-10 10:43:36.000000000 +0200 @@ -830,11 +830,12 @@ return 0; } - if (log->criterium == ROT_SIZE) { - state->doRotate = (sb.st_size >= log->threshhold); - } else if (force) { + if (force) { /* user forced rotation of logs from command line */ - state->doRotate = 1; + state->doRotate = 1; + } + else if (log->criterium == ROT_SIZE) { + state->doRotate = (sb.st_size >= log->threshhold); } else if (mktime(&state->lastRotated) - mktime(&now) > (25 * 3600)) { /* 25 hours allows for DST changes as well as geographical moves */ message(MESS_ERROR, @@ -1601,6 +1602,11 @@ message(MESS_DEBUG, "old logs are removed\n"); } + if (log->numFiles == 0) { + message(MESS_DEBUG, "No logs found. Rotation not needed.\n"); + return 0; + } + if (log->flags & LOG_FLAG_SU) { if (switch_user(log->suUid, log->suGid) != 0) { return 1; @@ -1657,10 +1663,12 @@ hasErrors |= logHasErrors[i]; } - /* (nemam chyby nebo shared) a (nemam chyby nebo nonshared) */ if (log->pre - && (!logHasErrors[j] || log->flags & LOG_FLAG_SHAREDSCRIPTS) && - ((!hasErrors && state[j]->doRotate) || (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && state[j]->doRotate) ) ) { + && (!( + ((logHasErrors[j] || !state[j]->doRotate) && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) + || (hasErrors && (log->flags & LOG_FLAG_SHAREDSCRIPTS)) + )) + ) { if (!numRotated) { message(MESS_DEBUG, "not running prerotate script, " "since no logs will be rotated\n"); @@ -1694,8 +1702,11 @@ } if (log->post - && (!logHasErrors[j] || log->flags & LOG_FLAG_SHAREDSCRIPTS) && - ((!hasErrors && state[j]->doRotate) || (!(log->flags & LOG_FLAG_SHAREDSCRIPTS) && state[j]->doRotate) ) ) { + && (!( + ((logHasErrors[j] || !state[j]->doRotate) && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) + || (hasErrors && (log->flags & LOG_FLAG_SHAREDSCRIPTS)) + )) + ) { if (!numRotated) { message(MESS_DEBUG, "not running postrotate script, " "since no logs were rotated\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/logrotate.spec new/logrotate-3.8.7/logrotate.spec --- old/logrotate-3.8.5/logrotate.spec 2013-06-10 14:02:36.000000000 +0200 +++ new/logrotate-3.8.7/logrotate.spec 2013-10-10 10:43:36.000000000 +0200 @@ -1,6 +1,6 @@ Summary: Rotates, compresses, removes and mails system log files Name: logrotate -Version: 3.8.5 +Version: 3.8.7 Release: 1 License: GPL+ Group: System Environment/Base @@ -52,6 +52,12 @@ %attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status %changelog +* Thu Oct 10 2013 Jan Kaluza <[email protected]> 3.8.7-1 +- new upstream version + +* Wed Jul 31 2013 Jan Kaluza <[email protected]> 3.8.6-1 +- new upstream version + * Mon Jun 10 2013 Jan Kaluza <[email protected]> 3.8.5-1 - new upstream version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/test/test new/logrotate-3.8.7/test/test --- old/logrotate-3.8.5/test/test 2013-06-10 14:02:36.000000000 +0200 +++ new/logrotate-3.8.7/test/test 2013-10-10 10:43:36.000000000 +0200 @@ -4,7 +4,7 @@ SELINUX_TESTS=0 LOGROTATE=../logrotate M="-m ./mailer" -S=-"s state" +S="-s state" RLR="$LOGROTATE $M $S" # -- ACL - BEGIN -------------------------------- @@ -46,6 +46,17 @@ fi fi fi + +if [ $SELINUX_TESTS == 1 ]; then + # if logrotate_tmp_t, we can't continue with SELinux tests... + touch .selinuxtest + chcon --type=logrotate_tmp_t .selinuxtest 2>/dev/null + if [ $? != 0 ]; then + SELINUX_TESTS=0 + echo "SELinux context 'logrotate_tmp_t' does not exist. SELinux tests will not be executed." + fi + rm -f .selinuxtest +fi # -- SELINUX - END ---------------------------------- @@ -301,22 +312,22 @@ preptest test.log 6 1 preptest anothertest.log 6 1 if [ $SELINUX_TESTS == 1 ]; then - chcon --type=httpd_sys_content_t test.log + chcon --type=logrotate_tmp_t test.log else echo "Skipping SELinux part of test 6" fi $RLR test-config.6 --force if [ $SELINUX_TESTS == 1 ]; then - ls -Z test.log.0|grep httpd_sys_content_t >/dev/null + ls -Z test.log.0|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then - echo "test.log.0 should have selinux context httpd_sys_content_t." + echo "test.log.0 should have selinux context logrotate_tmp_t." exit 3 fi - ls -Z anothertest.log.0|grep httpd_sys_content_t >/dev/null + ls -Z anothertest.log.0|grep logrotate_tmp_t >/dev/null if [ $? == 0 ]; then - echo "anothertest.log.0 should not have selinux context httpd_sys_content_t." + echo "anothertest.log.0 should not have selinux context logrotate_tmp_t." exit 3 fi fi @@ -378,7 +389,7 @@ preptest test.log 10 1 if [ $SELINUX_TESTS == 1 ]; then - chcon --type=httpd_sys_content_t test.log + chcon --type=logrotate_tmp_t test.log else echo "Skipping SELinux part of test 10" fi @@ -395,16 +406,16 @@ $RLR test-config.10 --force if [ $SELINUX_TESTS == 1 ]; then - ls -Z test.log.2.gz|grep httpd_sys_content_t >/dev/null + ls -Z test.log.2.gz|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then - echo "test.log.2.gz should have selinux context httpd_sys_content_t." + echo "test.log.2.gz should have selinux context logrotate_tmp_t." ls -Z test.log.2.gz exit 3 fi - ls -Z test.log.1|grep httpd_sys_content_t >/dev/null + ls -Z test.log.1|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then - echo "test.log.1 should have selinux context httpd_sys_content_t." + echo "test.log.1 should have selinux context logrotate_tmp_t." ls -Z test.log.1 exit 3 fi @@ -1154,7 +1165,7 @@ if [ $SELINUX_TESTS == 1 ]; then - chcon --type=httpd_sys_content_t test.log + chcon --type=logrotate_tmp_t test.log else echo "Skipping SELinux part of test 6" fi @@ -1172,13 +1183,13 @@ logrotate state -- version 2 EOF -chcon --type=httpd_sys_content_t state +chcon --type=logrotate_tmp_t state $RLR test-config.47 -ls -Z state|grep httpd_sys_content_t >/dev/null +ls -Z state|grep logrotate_tmp_t >/dev/null if [ $? != 0 ]; then - echo "state file should have selinux context httpd_sys_content_t." + echo "state file should have selinux context logrotate_tmp_t." exit 3 fi @@ -1284,7 +1295,67 @@ echo "Does not have GNU Date, skipping part of this test" fi +cleanup 51 + +# ------------------------------- Test 51 ------------------------------------ +# regression in 3.8.4, logrotate crashes with sharedscripts when 0 logs rotated +preptest test.log 51 1 0 + +# It's memory corruption and without something in state file, it won't crash +# reliably. It would be better to run valgrind here and check the errors, but +# I don't want the test-suite to depend on valgrind... +cat > state << EOF +logrotate state -- version 2 +"/var/log/httpd/backend_error_log" 2013-6-16 +"/var/log/tokyotyrant/*.log" 2011-5-30 +"/var/log/mailman/digest" 2011-5-30 +"/var/log/piranha/piranha-gui-access" 2011-5-30 +"/var/log/boincerr.log" 2011-5-30 +"/var/log/btmp" 2013-7-9 +"/var/log/httpd/a_log" 2011-11-15 +"/var/log/cups/*_log" 2012-7-19 +"/var/log/rabbitmq/*.log" 2011-5-30 +"/var/log/func/func.log" 2011-11-17 +"/var/log/wtmp" 2013-7-9 +"/var/log/glusterfs/*glusterd.vol.log" 2011-11-17 +"/var/log/imapd.log" 2011-5-30 +"/var/log/cobbler/cobbler.log" 2011-11-6 +"/var/log/httpd/ssl_access_log" 2013-3-27 +"/var/log/mrepo.log" 2011-5-30 +EOF + +$RLR test-config.51 + +if [ $? != 0 ]; then + echo "logrotate ended with non-zero exit code (probably crashed)" + exit 3 +fi + +cleanup 52 +# ------------------------------- Test 52 ------------------------------------ +# sharedscripts are not run if the first log file does not exist +preptest test.log 52 1 0 +$RLR test-config.52 + +checkoutput <<EOF +test.log 0 +test.log.1 0 zero +scriptout 0 foo +EOF + +cleanup 53 + +# ------------------------------- Test 53 ------------------------------------ +# test if --force works +preptest test.log 53 1 0 + +$RLR test-config.53 --force + +checkoutput <<EOF +test.log 0 +test.log.1 0 zero +EOF cleanup diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/test/test-config.51.in new/logrotate-3.8.7/test/test-config.51.in --- old/logrotate-3.8.5/test/test-config.51.in 1970-01-01 01:00:00.000000000 +0100 +++ new/logrotate-3.8.7/test/test-config.51.in 2013-07-31 13:34:31.000000000 +0200 @@ -0,0 +1,8 @@ +/var/log/this_dir_does_not_exist/*log { + size 1 + missingok + sharedscripts + prerotate + /usr/bin/some-program + endscript +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/test/test-config.52.in new/logrotate-3.8.7/test/test-config.52.in --- old/logrotate-3.8.5/test/test-config.52.in 1970-01-01 01:00:00.000000000 +0100 +++ new/logrotate-3.8.7/test/test-config.52.in 2013-07-31 13:34:31.000000000 +0200 @@ -0,0 +1,13 @@ +create + +/var/log/does_not_exist.log &DIR&/test.log { + rotate 14 + size 2 + missingok + sharedscripts + postrotate + touch scriptout + echo $(cat scriptout) foo > foo + mv foo scriptout + endscript +} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logrotate-3.8.5/test/test-config.53.in new/logrotate-3.8.7/test/test-config.53.in --- old/logrotate-3.8.5/test/test-config.53.in 1970-01-01 01:00:00.000000000 +0100 +++ new/logrotate-3.8.7/test/test-config.53.in 2013-10-10 10:43:36.000000000 +0200 @@ -0,0 +1,7 @@ +create + +&DIR&/test.log { + rotate 14 + size 4096 + missingok +} \ No newline at end of file -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
