Gentoo Archives: gentoo-commits

From: "JosA MarAa Alonso (nimiux)" <nimiux@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/logrotate/files: logrotate-3.9.1-Werror.patch logrotate-3.9.1-fbsd.patch logrotate-3.9.1-ignore-hidden.patch logrotate-3.9.1-atomic-create.patch logrotate-3.9.1-noasprintf.patch
Date: Sun, 28 Jun 2015 12:14:38
Message-Id: 20150628121425.B6A6F745@oystercatcher.gentoo.org
1 nimiux 15/06/28 12:14:25
2
3 Added: logrotate-3.9.1-Werror.patch
4 logrotate-3.9.1-fbsd.patch
5 logrotate-3.9.1-ignore-hidden.patch
6 logrotate-3.9.1-atomic-create.patch
7 logrotate-3.9.1-noasprintf.patch
8 Log:
9 version bump
10
11 (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key F253DB15)
12
13 Revision Changes Path
14 1.1 app-admin/logrotate/files/logrotate-3.9.1-Werror.patch
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-Werror.patch?rev=1.1&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-Werror.patch?rev=1.1&content-type=text/plain
18
19 Index: logrotate-3.9.1-Werror.patch
20 ===================================================================
21 diff -Nuar a/Makefile.am b/Makefile.am
22 --- a/Makefile.am 2015-04-03 09:39:35.000000000 +0200
23 +++ b/Makefile.am 2015-06-28 14:03:12.429999875 +0200
24 @@ -1,7 +1,7 @@
25 MAN = logrotate.8
26 MAN5 = logrotate.conf.5
27
28 -AM_CFLAGS = -Wall -Werror
29 +AM_CFLAGS = -Wall
30 sbin_PROGRAMS = logrotate
31 logrotate_SOURCES = logrotate.c log.c config.c basenames.c
32
33
34
35
36 1.1 app-admin/logrotate/files/logrotate-3.9.1-fbsd.patch
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-fbsd.patch?rev=1.1&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-fbsd.patch?rev=1.1&content-type=text/plain
40
41 Index: logrotate-3.9.1-fbsd.patch
42 ===================================================================
43 diff -Nuar a/config.c b/config.c
44 --- a/config.c 2015-06-28 13:54:18.309999889 +0200
45 +++ b/config.c 2015-06-28 13:56:49.599999885 +0200
46 @@ -1,6 +1,6 @@
47 #include "queue.h"
48 /* Alloca is defined in stdlib.h in NetBSD */
49 -#ifndef __NetBSD__
50 +#if !defined(__NetBSD__) && !defined(__FreeBSD__)
51 #include <alloca.h>
52 #endif
53 #include <limits.h>
54 @@ -24,6 +24,10 @@
55 #include <fnmatch.h>
56 #include <sys/mman.h>
57
58 +#if !defined(PATH_MAX) && defined(__FreeBSD__)
59 +#include <sys/param.h>
60 +#endif
61 +
62 #include "basenames.h"
63 #include "log.h"
64 #include "logrotate.h"
65 diff -Nuar a/logrotate.c b/logrotate.c
66 --- a/logrotate.c 2015-04-03 09:39:35.000000000 +0200
67 +++ b/logrotate.c 2015-06-28 13:57:18.449999884 +0200
68 @@ -1,6 +1,6 @@
69 #include "queue.h"
70 /* alloca() is defined in stdlib.h in NetBSD */
71 -#ifndef __NetBSD__
72 +#if !defined(__NetBSD__) && !defined(__FreeBSD__)
73 #include <alloca.h>
74 #endif
75 #include <limits.h>
76 @@ -26,6 +26,10 @@
77 #include <limits.h>
78 #endif
79
80 +#if !defined(PATH_MAX) && defined(__FreeBSD__)
81 +#include <sys/param.h>
82 +#endif
83 +
84 #include "basenames.h"
85 #include "log.h"
86 #include "logrotate.h"
87 diff -Nuar a/Makefile b/Makefile
88 --- a/Makefile 2015-04-03 09:39:35.000000000 +0200
89 +++ b/Makefile 2015-06-28 13:58:05.729999883 +0200
90 @@ -22,7 +22,9 @@
91
92 ifeq ($(WITH_ACL),yes)
93 CFLAGS += -DWITH_ACL
94 +ifneq ($(OS_NAME),FreeBSD)
95 LOADLIBES += -lacl
96 +endif
97 # See pretest
98 TEST_ACL=1
99 else
100
101
102
103 1.1 app-admin/logrotate/files/logrotate-3.9.1-ignore-hidden.patch
104
105 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-ignore-hidden.patch?rev=1.1&view=markup
106 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-ignore-hidden.patch?rev=1.1&content-type=text/plain
107
108 Index: logrotate-3.9.1-ignore-hidden.patch
109 ===================================================================
110 diff -Nuar a/config.c b/config.c
111 --- a/config.c 2015-04-03 09:39:35.000000000 +0200
112 +++ b/config.c 2015-06-28 13:54:18.309999889 +0200
113 @@ -359,7 +359,10 @@
114 char *pattern;
115
116 /* Check if fname is '.' or '..'; if so, return false */
117 - if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
118 + /* Don't include 'hidden' files either; this breaks Gentoo
119 + portage config file management http://bugs.gentoo.org/87683 */
120 + if (fname[0] == '.')
121 +
122 return 0;
123
124 /* Check if fname is ending in a taboo-extension; if so, return false */
125
126
127
128 1.1 app-admin/logrotate/files/logrotate-3.9.1-atomic-create.patch
129
130 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-atomic-create.patch?rev=1.1&view=markup
131 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-atomic-create.patch?rev=1.1&content-type=text/plain
132
133 Index: logrotate-3.9.1-atomic-create.patch
134 ===================================================================
135 diff -Nuar a/logrotate.c b/logrotate.c
136 --- a/logrotate.c 2015-06-28 13:57:18.449999884 +0200
137 +++ b/logrotate.c 2015-06-28 14:02:20.799999876 +0200
138 @@ -371,15 +371,18 @@
139 int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode)
140 {
141 int fd;
142 - struct stat sb_create;
143 - int acl_set = 0;
144 -
145 - fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
146 - (S_IRUSR | S_IWUSR) & sb->st_mode);
147 + int acl_set = 0;
148 + struct stat sb_create;
149 + char template[PATH_MAX + 1];
150 + mode_t umask_value;
151 + snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
152 + umask_value = umask(0000);
153 + fd = mkostemp(template, (flags | O_EXCL | O_NOFOLLOW));
154 + umask(umask_value);
155
156 if (fd < 0) {
157 - message(MESS_ERROR, "error creating output file %s: %s\n",
158 - fileName, strerror(errno));
159 + message(MESS_ERROR, "error creating unique temp file: %s\n",
160 + strerror(errno));
161 return -1;
162 }
163 if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) {
164 @@ -430,6 +433,13 @@
165 }
166 }
167
168 + if (rename(template, fileName)) {
169 + message(MESS_ERROR, "error renaming temp file to %s: %s\n",
170 + fileName, strerror(errno));
171 + close(fd);
172 + return -1;
173 + }
174 +
175 return fd;
176 }
177
178
179
180
181 1.1 app-admin/logrotate/files/logrotate-3.9.1-noasprintf.patch
182
183 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-noasprintf.patch?rev=1.1&view=markup
184 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.9.1-noasprintf.patch?rev=1.1&content-type=text/plain
185
186 Index: logrotate-3.9.1-noasprintf.patch
187 ===================================================================
188 diff -Nuar a/config.c b/config.c
189 --- a/config.c 2015-06-28 13:56:49.599999885 +0200
190 +++ b/config.c 2015-06-28 13:59:34.799999880 +0200
191 @@ -49,39 +49,6 @@
192 #include "asprintf.c"
193 #endif
194
195 -#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
196 -#include <stdarg.h>
197 -
198 -int asprintf(char **string_ptr, const char *format, ...)
199 -{
200 - va_list arg;
201 - char *str;
202 - int size;
203 - int rv;
204 -
205 - va_start(arg, format);
206 - size = vsnprintf(NULL, 0, format, arg);
207 - size++;
208 - va_start(arg, format);
209 - str = malloc(size);
210 - if (str == NULL) {
211 - va_end(arg);
212 - /*
213 - * Strictly speaking, GNU asprintf doesn't do this,
214 - * but the caller isn't checking the return value.
215 - */
216 - fprintf(stderr, "failed to allocate memory\\n");
217 - exit(1);
218 - }
219 - rv = vsnprintf(str, size, format, arg);
220 - va_end(arg);
221 -
222 - *string_ptr = str;
223 - return (rv);
224 -}
225 -
226 -#endif
227 -
228 #if !defined(strndup)
229 char *strndup(const char *s, size_t n)
230 {
231 diff -Nuar a/logrotate.h b/logrotate.h
232 --- a/logrotate.h 2015-04-03 09:39:35.000000000 +0200
233 +++ b/logrotate.h 2015-06-28 13:59:47.429999880 +0200
234 @@ -80,8 +80,5 @@
235 extern int debug;
236
237 int readAllConfigPaths(const char **paths);
238 -#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
239 -int asprintf(char **string_ptr, const char *format, ...);
240 -#endif
241
242 #endif