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