summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé María Alonso <nimiux@gentoo.org>2013-05-10 19:45:40 +0000
committerJosé María Alonso <nimiux@gentoo.org>2013-05-10 19:45:40 +0000
commit99a949f82f61fd1efc089e7cbad96190b7553eee (patch)
tree829171b80c060c0061a6077c444216c261ee5e6e /app-admin/logrotate/files
parentsplit out valgrind part for USE=debug as proposed on bug 468984 (diff)
downloadgentoo-2-99a949f82f61fd1efc089e7cbad96190b7553eee.tar.gz
gentoo-2-99a949f82f61fd1efc089e7cbad96190b7553eee.tar.bz2
gentoo-2-99a949f82f61fd1efc089e7cbad96190b7553eee.zip
Revision bump
(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key D628E536)
Diffstat (limited to 'app-admin/logrotate/files')
-rw-r--r--app-admin/logrotate/files/logrotate-3.8.4-atomic-create.patch43
-rw-r--r--app-admin/logrotate/files/logrotate-3.8.4-datehack.patch12
-rw-r--r--app-admin/logrotate/files/logrotate-3.8.4-fbsd.patch57
-rw-r--r--app-admin/logrotate/files/logrotate-3.8.4-ignore-hidden.patch14
-rw-r--r--app-admin/logrotate/files/logrotate-3.8.4-noasprintf.patch55
-rw-r--r--app-admin/logrotate/files/logrotate.conf5
6 files changed, 184 insertions, 2 deletions
diff --git a/app-admin/logrotate/files/logrotate-3.8.4-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.8.4-atomic-create.patch
new file mode 100644
index 000000000000..28fd0375ac32
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.8.4-atomic-create.patch
@@ -0,0 +1,43 @@
+diff -Nur a/logrotate.c b/logrotate.c
+--- a/logrotate.c 2013-05-10 21:06:07.459903230 +0200
++++ b/logrotate.c 2013-05-10 21:15:15.849900150 +0200
+@@ -300,14 +300,20 @@
+ int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode)
+ {
+ int fd;
+- struct stat sb_create;
+
+- fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
+- (S_IRUSR | S_IWUSR) & sb->st_mode);
++ struct stat sb_create;
++ char template[PATH_MAX + 1];
++ char *fname;
++ mode_t umask_value;
++ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
++ umask_value = umask(0000);
++ fname = mktemp(template);
++ fd = open(fname, (flags | O_EXCL | O_NOFOLLOW), (S_IRUSR | S_IWUSR) & sb->st_mode);
++ umask(umask_value);
+
+ if (fd < 0) {
+- message(MESS_ERROR, "error creating output file %s: %s\n",
+- fileName, strerror(errno));
++ message(MESS_ERROR, "error creating unique temp file: %s\n",
++ strerror(errno));
+ return -1;
+ }
+ if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) {
+@@ -352,6 +358,13 @@
+ }
+ #endif
+
++ if (rename(template, fileName)) {
++ message(MESS_ERROR, "error renaming temp file to %s: %s\n",
++ fileName, strerror(errno));
++ close(fd);
++ return -1;
++ }
++
+ return fd;
+ }
+
diff --git a/app-admin/logrotate/files/logrotate-3.8.4-datehack.patch b/app-admin/logrotate/files/logrotate-3.8.4-datehack.patch
new file mode 100644
index 000000000000..d320666d3631
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.8.4-datehack.patch
@@ -0,0 +1,12 @@
+diff -Nur a/logrotate.c b/logrotate.c
+--- a/logrotate.c 2013-04-30 10:29:31.000000000 +0200
++++ b/logrotate.c 2013-05-10 20:58:58.229905641 +0200
+@@ -1851,7 +1851,7 @@
+ }
+
+ /* Hack to hide earlier bug */
+- if ((year != 1900) && (year < 1996 || year > 2100)) {
++ if ((year != 1900) && (year < 1970 || year > 2100)) {
+ message(MESS_ERROR,
+ "bad year %d for file %s in state file %s\n", year,
+ argv[0], stateFilename);
diff --git a/app-admin/logrotate/files/logrotate-3.8.4-fbsd.patch b/app-admin/logrotate/files/logrotate-3.8.4-fbsd.patch
new file mode 100644
index 000000000000..e0d06d8d53ee
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.8.4-fbsd.patch
@@ -0,0 +1,57 @@
+diff -Nur a/Makefile b/Makefile
+--- a/Makefile 2013-04-30 10:29:31.000000000 +0200
++++ b/Makefile 2013-05-10 21:07:51.189902648 +0200
+@@ -22,7 +22,9 @@
+
+ ifeq ($(WITH_ACL),yes)
+ CFLAGS += -DWITH_ACL
++ifneq ($(OS_NAME),FreeBSD)
+ LOADLIBES += -lacl
++endif
+ # See pretest
+ TEST_ACL=1
+ else
+diff -Nur a/config.c b/config.c
+--- a/config.c 2013-05-10 21:03:29.309904119 +0200
++++ b/config.c 2013-05-10 21:05:13.989903531 +0200
+@@ -1,6 +1,6 @@
+ #include <sys/queue.h>
+ /* Alloca is defined in stdlib.h in NetBSD */
+-#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__FreeBSD__)
+ #include <alloca.h>
+ #endif
+ #include <limits.h>
+@@ -24,6 +24,10 @@
+ #include <fnmatch.h>
+ #include <sys/mman.h>
+
++#if !defined(PATH_MAX) && defined(__FreeBSD__)
++#include <sys/param.h>
++#endif
++
+ #include "basenames.h"
+ #include "log.h"
+ #include "logrotate.h"
+diff -Nur a/logrotate.c b/logrotate.c
+--- a/logrotate.c 2013-05-10 20:58:58.229905641 +0200
++++ b/logrotate.c 2013-05-10 21:06:07.459903230 +0200
+@@ -1,6 +1,6 @@
+ #include <sys/queue.h>
+ /* alloca() is defined in stdlib.h in NetBSD */
+-#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__FreeBSD__)
+ #include <alloca.h>
+ #endif
+ #include <limits.h>
+@@ -41,6 +41,10 @@
+
+ static acl_type prev_acl = NULL;
+
++#if !defined(PATH_MAX) && defined(__FreeBSD__)
++#include <sys/param.h>
++#endif
++
+ #include "basenames.h"
+ #include "log.h"
+ #include "logrotate.h"
diff --git a/app-admin/logrotate/files/logrotate-3.8.4-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.8.4-ignore-hidden.patch
new file mode 100644
index 000000000000..a76937fd8bfb
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.8.4-ignore-hidden.patch
@@ -0,0 +1,14 @@
+diff -Nur a/config.c b/config.c
+--- a/config.c 2013-04-30 10:29:31.000000000 +0200
++++ b/config.c 2013-05-10 21:03:29.309904119 +0200
+@@ -255,7 +255,9 @@
+ char *pattern;
+
+ /* Check if fname is '.' or '..'; if so, return false */
+- if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
++ /* Don't include 'hidden' files either; this breaks Gentoo
++ portage config file management http://bugs.gentoo.org/87683 */
++ if (fname[0] == '.')
+ return 0;
+
+ /* Check if fname is ending in a taboo-extension; if so, return false */
diff --git a/app-admin/logrotate/files/logrotate-3.8.4-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.8.4-noasprintf.patch
new file mode 100644
index 000000000000..e4d9f87e501d
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.8.4-noasprintf.patch
@@ -0,0 +1,55 @@
+diff -Nur a/config.c b/config.c
+--- a/config.c 2013-05-10 21:05:13.989903531 +0200
++++ b/config.c 2013-05-10 21:12:05.859901217 +0200
+@@ -49,39 +49,6 @@
+ #include "asprintf.c"
+ #endif
+
+-#if !defined(asprintf)
+-#include <stdarg.h>
+-
+-int asprintf(char **string_ptr, const char *format, ...)
+-{
+- va_list arg;
+- char *str;
+- int size;
+- int rv;
+-
+- va_start(arg, format);
+- size = vsnprintf(NULL, 0, format, arg);
+- size++;
+- va_start(arg, format);
+- str = malloc(size);
+- if (str == NULL) {
+- va_end(arg);
+- /*
+- * Strictly speaking, GNU asprintf doesn't do this,
+- * but the caller isn't checking the return value.
+- */
+- fprintf(stderr, "failed to allocate memory\\n");
+- exit(1);
+- }
+- rv = vsnprintf(str, size, format, arg);
+- va_end(arg);
+-
+- *string_ptr = str;
+- return (rv);
+-}
+-
+-#endif
+-
+ #if !defined(strndup)
+ char *strndup(const char *s, size_t n)
+ {
+diff -Nur a/logrotate.h b/logrotate.h
+--- a/logrotate.h 2013-04-30 10:29:31.000000000 +0200
++++ b/logrotate.h 2013-05-10 21:12:25.139901109 +0200
+@@ -67,8 +67,5 @@
+ extern int debug;
+
+ int readAllConfigPaths(const char **paths);
+-#if !defined(asprintf)
+-int asprintf(char **string_ptr, const char *format, ...);
+-#endif
+
+ #endif
diff --git a/app-admin/logrotate/files/logrotate.conf b/app-admin/logrotate/files/logrotate.conf
index 25dd13495e13..690a5f7fe078 100644
--- a/app-admin/logrotate/files/logrotate.conf
+++ b/app-admin/logrotate/files/logrotate.conf
@@ -1,4 +1,4 @@
-# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.3 2008/12/24 20:49:10 dang Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.4 2013/05/10 19:45:39 nimiux Exp $
#
# Logrotate default configuration file for Gentoo Linux
#
@@ -27,10 +27,11 @@ notifempty
nomail
noolddir
-# no packages own lastlog or wtmp -- we'll rotate them here
+# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
+ minsize 1M
rotate 1
}