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