nimiux      14/11/04 19:55:09

  Added:                logrotate-3.8.8-fbsd.patch
                        logrotate-3.8.8-ignore-hidden.patch
                        logrotate-3.8.8-noasprintf.patch
                        logrotate-3.8.8-atomic-create.patch
  Log:
  Version bump. (bug #528036)
  
  (Portage version: 2.2.8-r2/cvs/Linux x86_64, signed Manifest commit with key 
F253DB15)

Revision  Changes    Path
1.1                  app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch?rev=1.1&content-type=text/plain

Index: logrotate-3.8.8-fbsd.patch
===================================================================
diff -Nuar a/config.c b/config.c
--- a/config.c  2014-10-16 13:12:35.000000000 +0200
+++ b/config.c  2014-11-04 19:22:31.750055957 +0100
@@ -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 -Nuar a/logrotate.c b/logrotate.c
--- a/logrotate.c       2014-10-16 13:12:35.000000000 +0200
+++ b/logrotate.c       2014-11-04 19:25:35.440056498 +0100
@@ -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>
@@ -25,6 +25,10 @@
 #include <limits.h>
 #endif
 
+#if !defined(PATH_MAX) && defined(__FreeBSD__)
+#include <sys/param.h>
+#endif
+
 #include "basenames.h"
 #include "log.h"
 #include "logrotate.h"
diff -Nuar a/Makefile b/Makefile
--- a/Makefile  2014-10-16 13:12:35.000000000 +0200
+++ b/Makefile  2014-11-04 19:26:07.850056594 +0100
@@ -22,7 +22,9 @@
 
 ifeq ($(WITH_ACL),yes)
 CFLAGS += -DWITH_ACL
+ifneq ($(OS_NAME),FreeBSD)
 LOADLIBES += -lacl
+endif
 # See pretest
 TEST_ACL=1
 else



1.1                  
app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch?rev=1.1&content-type=text/plain

Index: logrotate-3.8.8-ignore-hidden.patch
===================================================================
diff -Nuar a/config.c b/config.c
--- a/config.c  2014-10-16 13:12:35.000000000 +0200
+++ b/config.c  2014-11-04 19:19:55.200055496 +0100
@@ -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 */



1.1                  app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch?rev=1.1&content-type=text/plain

Index: logrotate-3.8.8-noasprintf.patch
===================================================================
diff -Nuar a/config.c b/config.c
--- a/config.c  2014-10-16 13:12:35.000000000 +0200
+++ b/config.c  2014-11-04 19:28:58.110057096 +0100
@@ -45,39 +45,6 @@
 #include "asprintf.c"
 #endif
 
-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
-#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 -Nuar a/logrotate.h b/logrotate.h
--- a/logrotate.h       2014-10-16 13:12:35.000000000 +0200
+++ b/logrotate.h       2014-11-04 19:29:15.610057147 +0100
@@ -75,8 +75,5 @@
 extern int debug;
 
 int readAllConfigPaths(const char **paths);
-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
-int asprintf(char **string_ptr, const char *format, ...);
-#endif
 
 #endif



1.1                  
app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch?rev=1.1&content-type=text/plain

Index: logrotate-3.8.8-atomic-create.patch
===================================================================
diff -Nuar a/logrotate.c b/logrotate.c
--- a/logrotate.c       2014-10-16 13:12:35.000000000 +0200
+++ b/logrotate.c       2014-11-04 20:26:46.080067315 +0100
@@ -359,15 +359,20 @@
 int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, 
int force_mode)
 {
     int fd;
-       struct stat sb_create;
-       int acl_set = 0;
-
-       fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
-               (S_IRUSR | S_IWUSR) & sb->st_mode);
+    int acl_set = 0;
+    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)) {
@@ -418,6 +423,13 @@
                }
        }
 
+    if (rename(template, fileName)) {
+        message(MESS_ERROR, "error renaming temp file to %s: %s\n",
+        fileName, strerror(errno));
+        close(fd);
+        return -1;
+    }
+
     return fd;
 }
 




Reply via email to