logrotate/logrotate-3.7.8-suse.patch
Michal Vyskocil a7ebe2d3f3 Accepting request 81574 from home:vitezslav_cizek:branches:Base:System
- update to 3.8.1
- dropped CVE patches as they were merged to upstream
- changelog
  - fixed 1 memory leak in prerotateSingleLog
  - do not redirect logrotate errors to /dev/null in cron script
  - fixed "size" directive parsing
  - handle situation when acl_get_fd is supported, but acl_set_fd is not
  - added "maxsize" directive (see man page)
  - added "dateyesterday" option (see man page)
  - fixed crash when config file had exactly 4096*N bytes
  - added WITH_ACL make option to link against -lacl and preserve ACLs
    during rotation
  - added "su" option to define user/group for rotation. Logrotate now
    skips directories which are world writable or writable by group
    which is not "root" unless "su" directive is used.
  - fixed CVE-2011-1098: race condition by creation of new files
  - fixed possible shell injection when using "shred" directive (CVE-2011-1154)
  - fixed escaping of file names within 'write state' action (CVE-2011-1155)
  - better 'size' directive description
  - fixed possible buffer-overflow when reading config files

OBS-URL: https://build.opensuse.org/request/show/81574
OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=18
2011-09-13 09:24:51 +00:00

46 lines
1.3 KiB
Diff

Index: Makefile
===================================================================
--- Makefile.orig
+++ Makefile
@@ -81,7 +81,7 @@ ifneq ($(STATEFILE),)
endif
BINDIR = $(BASEDIR)/sbin
-MANDIR ?= $(BASEDIR)/man
+MANDIR ?= $(BASEDIR)/share/man
#--------------------------------------------------------------------------
Index: examples/logrotate.cron
===================================================================
--- examples/logrotate.cron.orig
+++ examples/logrotate.cron
@@ -1,8 +1,23 @@
#!/bin/sh
-/usr/sbin/logrotate /etc/logrotate.conf
-EXITVALUE=$?
-if [ $EXITVALUE != 0 ]; then
- /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
+# exit immediately if there is another instance running
+if checkproc /usr/sbin/logrotate; then
+ /bin/logger -p cron.warning -t logrotate "ALERT another instance of logrotate is running - exiting"
+ exit 1
fi
+
+TMPF=`mktemp /tmp/logrotate.XXXXXXXXXX`
+
+/usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF
+EXITVALUE=${PIPESTATUS[0]}
+
+if [ $EXITVALUE != 0 ]; then
+ # wait a sec, we might just have restarted syslog
+ sleep 1
+ # tell what went wrong
+ /bin/logger -p cron.warning -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
+ /bin/logger -p cron.warning -t logrotate -f $TMPF
+ fi
+
+rm -f $TMPF
exit 0