Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pax-utils:master commit in: /
Date: Sun, 29 Jan 2023 05:56:41
Message-Id: 1674971792.755a512e6a3c2b015b8d54dc98f2f48bb9dd3971.sam@gentoo
1 commit: 755a512e6a3c2b015b8d54dc98f2f48bb9dd3971
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 29 05:40:05 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 29 05:56:32 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=755a512e
7
8 Undo IWYU fixes
9
10 I wasn't paying enough attention, it's better to just fold the needed
11 bits into porting.h.
12
13 This reverts commit ffedc60fa41d307bda28fd108e6ff1b8da1fc2ee.
14 This reverts commit f8287200aec0ca33ef07fafcdd5aef0aa6eb1306.
15 This reverts commit aa907a42d89ddfd5a7e64d8182a1da35277f2f6e.
16
17 Bug: https://github.com/gentoo/pax-utils/pull/11#issuecomment-1407566344
18 Signed-off-by: Sam James <sam <AT> gentoo.org>
19
20 dumpelf.c | 14 --------------
21 paxelf.c | 14 --------------
22 paxelf.h | 7 -------
23 paxinc.c | 8 --------
24 paxinc.h | 11 +----------
25 paxldso.c | 17 -----------------
26 paxldso.h | 4 ----
27 paxmacho.c | 13 -------------
28 paxmacho.h | 4 ----
29 pspax.c | 22 +---------------------
30 scanelf.c | 23 -----------------------
31 scanmacho.c | 20 --------------------
32 seccomp-bpf.c | 1 -
33 seccomp-bpf.h | 2 --
34 security.c | 13 -------------
35 security.h | 2 --
36 xfuncs.c | 7 -------
37 xfuncs.h | 2 --
38 18 files changed, 2 insertions(+), 182 deletions(-)
39
40 diff --git a/dumpelf.c b/dumpelf.c
41 index 877b0db..4742a50 100644
42 --- a/dumpelf.c
43 +++ b/dumpelf.c
44 @@ -8,21 +8,7 @@
45
46 const char argv0[] = "dumpelf";
47
48 -#include <getopt.h>
49 -#include <inttypes.h>
50 -#include <stdbool.h>
51 -#include <stddef.h>
52 -#include <stdio.h>
53 -#include <stdlib.h>
54 -#include <string.h>
55 -#include <time.h>
56 -#include <unistd.h>
57 -
58 #include "paxinc.h"
59 -#include "elf.h"
60 -#include "pax_utils_version.h"
61 -#include "porting.h"
62 -#include "security.h"
63
64 /* prototypes */
65 static void dump_ehdr(const elfobj *elf, const void *ehdr);
66
67 diff --git a/paxelf.c b/paxelf.c
68 index b072ba0..331f1b4 100644
69 --- a/paxelf.c
70 +++ b/paxelf.c
71 @@ -6,21 +6,7 @@
72 * Copyright 2005-2012 Mike Frysinger - <vapier@g.o>
73 */
74
75 -#include <fcntl.h>
76 -#include <stddef.h>
77 -#include <stdint.h>
78 -#include <stdio.h>
79 -#include <stdlib.h>
80 -#include <string.h>
81 -#include <sys/mman.h>
82 -#include <sys/stat.h>
83 -#include <unistd.h>
84 -
85 #include "paxinc.h"
86 -#include "elf.h"
87 -#include "paxelf.h"
88 -#include "porting.h"
89 -#include "xfuncs.h"
90
91 /*
92 * Setup a bunch of helper functions to translate
93
94 diff --git a/paxelf.h b/paxelf.h
95 index 31ef298..f252969 100644
96 --- a/paxelf.h
97 +++ b/paxelf.h
98 @@ -11,13 +11,6 @@
99 #ifndef _PAX_ELF_H
100 #define _PAX_ELF_H
101
102 -#include <stddef.h>
103 -#include <stdint.h>
104 -#include <stdio.h>
105 -#include <sys/types.h>
106 -
107 -#include "elf.h"
108 -
109 typedef struct {
110 const void *phdr;
111 const void *shdr;
112
113 diff --git a/paxinc.c b/paxinc.c
114 index f87e8a6..64a3069 100644
115 --- a/paxinc.c
116 +++ b/paxinc.c
117 @@ -11,14 +11,6 @@
118 #define IN_paxinc
119 #include "paxinc.h"
120
121 -#include <alloca.h>
122 -#include <stddef.h>
123 -#include <fcntl.h>
124 -#include <sys/stat.h>
125 -#include <unistd.h>
126 -
127 -#include "xfuncs.h"
128 -
129 char do_reverse_endian;
130
131 /* some of this ar code was taken from busybox */
132
133 diff --git a/paxinc.h b/paxinc.h
134 index 52bbefd..3dd163a 100644
135 --- a/paxinc.h
136 +++ b/paxinc.h
137 @@ -11,16 +11,6 @@
138 #ifndef _PAX_INC_H
139 #define _PAX_INC_H
140
141 -#include <byteswap.h>
142 -#include <errno.h>
143 -#include <stdbool.h>
144 -#include <stddef.h>
145 -#include <stdio.h>
146 -#include <stdlib.h>
147 -#include <string.h>
148 -#include <sys/types.h>
149 -#include <stdint.h>
150 -
151 #include "porting.h"
152 #include "xfuncs.h"
153 #include "security.h"
154 @@ -45,6 +35,7 @@
155 #include "elf.h"
156 #include "paxelf.h"
157 #include "paxldso.h"
158 +
159 /* Mach-O love */
160 #include "macho.h"
161 #include "paxmacho.h"
162
163 diff --git a/paxldso.c b/paxldso.c
164 index d40d7ef..ce7facd 100644
165 --- a/paxldso.c
166 +++ b/paxldso.c
167 @@ -6,24 +6,7 @@
168 * Copyright 2004-2016 Mike Frysinger - <vapier@g.o>
169 */
170
171 -#include <ctype.h>
172 -#include <fcntl.h>
173 -#include <glob.h>
174 -#include <stdbool.h>
175 -#include <stddef.h>
176 -#include <stdint.h>
177 -#include <stdio.h>
178 -#include <stdlib.h>
179 -#include <string.h>
180 -#include <sys/mman.h>
181 -#include <sys/stat.h>
182 -#include <unistd.h>
183 -
184 #include "paxinc.h"
185 -#include "elf.h"
186 -#include "paxelf.h"
187 -#include "paxldso.h"
188 -#include "xfuncs.h"
189
190 /*
191 * ld.so.cache logic
192
193 diff --git a/paxldso.h b/paxldso.h
194 index fd9f344..91c7eed 100644
195 --- a/paxldso.h
196 +++ b/paxldso.h
197 @@ -9,10 +9,6 @@
198 #ifndef _PAX_LDSO_H
199 #define _PAX_LDSO_H
200
201 -#include "paxelf.h"
202 -#include "porting.h"
203 -#include "xfuncs.h"
204 -
205 /*
206 * ld.so.cache logic
207 */
208
209 diff --git a/paxmacho.c b/paxmacho.c
210 index 39db1cb..74f02da 100644
211 --- a/paxmacho.c
212 +++ b/paxmacho.c
213 @@ -7,20 +7,7 @@
214 * 2008-2021 Fabian Groffen - <grobian@g.o>
215 */
216
217 -#include <byteswap.h>
218 -#include <fcntl.h>
219 -#include <stddef.h>
220 -#include <stdint.h>
221 -#include <stdlib.h>
222 -#include <string.h>
223 -#include <sys/mman.h>
224 -#include <sys/stat.h>
225 -#include <unistd.h>
226 -
227 #include "paxinc.h"
228 -#include "macho.h"
229 -#include "paxmacho.h"
230 -#include "xfuncs.h"
231
232 /* lil' static string pool */
233 static const char STR_BE[] = "BE";
234
235 diff --git a/paxmacho.h b/paxmacho.h
236 index b109af5..48ac854 100644
237 --- a/paxmacho.h
238 +++ b/paxmacho.h
239 @@ -12,10 +12,6 @@
240 #ifndef _PAX_MACHO_H
241 #define _PAX_MACHO_H
242
243 -#include <stddef.h>
244 -#include <byteswap.h>
245 -#include <stdint.h>
246 -
247 #include "macho.h"
248
249 #define MGET(swapped, value) (swapped ? (__typeof__(value))bswap_32(value) : value)
250
251 diff --git a/pspax.c b/pspax.c
252 index 369ed37..6094882 100644
253 --- a/pspax.c
254 +++ b/pspax.c
255 @@ -14,32 +14,12 @@
256
257 const char argv0[] = "pspax";
258
259 -#include <grp.h>
260 -#include <ctype.h>
261 -#include <dirent.h>
262 -#include <fcntl.h>
263 -#include <getopt.h>
264 -#include <pwd.h>
265 -#include <stdbool.h>
266 -#include <stddef.h>
267 -#include <stdint.h>
268 -#include <stdio.h>
269 -#include <stdlib.h>
270 -#include <string.h>
271 -#include <strings.h>
272 -#include <sys/stat.h>
273 -#include <unistd.h>
274 -
275 #include "paxinc.h"
276 -#include "elf.h"
277 -#include "pax_utils_version.h"
278 -#include "paxelf.h"
279 -#include "security.h"
280 +#include <grp.h>
281
282 #ifdef WANT_SYSCAP
283 # undef _POSIX_SOURCE
284 # include <sys/capability.h>
285 -
286 # define WRAP_SYSCAP(x) x
287 #else
288 # define WRAP_SYSCAP(x)
289
290 diff --git a/scanelf.c b/scanelf.c
291 index d6bb14b..50497b2 100644
292 --- a/scanelf.c
293 +++ b/scanelf.c
294 @@ -8,30 +8,7 @@
295
296 const char argv0[] = "scanelf";
297
298 -#include <ctype.h>
299 -#include <dirent.h>
300 -#include <errno.h>
301 -#include <fcntl.h>
302 -#include <fnmatch.h>
303 -#include <getopt.h>
304 -#include <inttypes.h>
305 -#include <regex.h>
306 -#include <stdbool.h>
307 -#include <stddef.h>
308 -#include <stdio.h>
309 -#include <stdlib.h>
310 -#include <string.h>
311 -#include <sys/mman.h>
312 -#include <sys/stat.h>
313 -#include <unistd.h>
314 -
315 #include "paxinc.h"
316 -#include "elf.h"
317 -#include "pax_utils_version.h"
318 -#include "paxldso.h"
319 -#include "porting.h"
320 -#include "security.h"
321 -#include "xfuncs.h"
322
323 #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
324
325
326 diff --git a/scanmacho.c b/scanmacho.c
327 index c38c5ed..e2aa485 100644
328 --- a/scanmacho.c
329 +++ b/scanmacho.c
330 @@ -11,27 +11,7 @@
331
332 const char argv0[] = "scanmacho";
333
334 -#include <dirent.h>
335 -#include <errno.h>
336 -#include <fcntl.h>
337 -#include <getopt.h>
338 -#include <stdbool.h>
339 -#include <stddef.h>
340 -#include <stdint.h>
341 -#include <stdio.h>
342 -#include <stdlib.h>
343 -#include <string.h>
344 -#include <sys/mman.h>
345 -#include <sys/stat.h>
346 -#include <unistd.h>
347 -
348 #include "paxinc.h"
349 -#include "macho.h"
350 -#include "pax_utils_version.h"
351 -#include "paxmacho.h"
352 -#include "porting.h"
353 -#include "security.h"
354 -#include "xfuncs.h"
355
356 #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
357
358
359 diff --git a/seccomp-bpf.c b/seccomp-bpf.c
360 index 7c3923f..1d64172 100644
361 --- a/seccomp-bpf.c
362 +++ b/seccomp-bpf.c
363 @@ -11,7 +11,6 @@ const char argv0[] = "seccomp-bpf";
364
365 #include <err.h>
366 #include <stdio.h>
367 -#include <stddef.h>
368 #include <stdlib.h>
369 #include <unistd.h>
370 #include <sys/mman.h>
371
372 diff --git a/seccomp-bpf.h b/seccomp-bpf.h
373 index 21499f7..80d6d94 100644
374 --- a/seccomp-bpf.h
375 +++ b/seccomp-bpf.h
376 @@ -4,8 +4,6 @@
377 * See seccomp-bpf.c for details. */
378 #undef SECCOMP_BPF_AVAILABLE
379
380 -#include <stdint.h>
381 -
382 #if defined(__aarch64__)
383 /* AARCH64 */
384 #define SECCOMP_BPF_AVAILABLE
385
386 diff --git a/security.c b/security.c
387 index f1a34df..19bf78f 100644
388 --- a/security.c
389 +++ b/security.c
390 @@ -5,21 +5,8 @@
391 * Copyright 2015 Mike Frysinger - <vapier@g.o>
392 */
393
394 -#include <errno.h>
395 -
396 -#ifdef WANT_SECCOMP
397 -#include <linux/seccomp.h>
398 -#include <linux/securebits.h>
399 -#endif
400 -
401 -#include <sched.h>
402 -#include <stdbool.h>
403 -#include <sys/prctl.h>
404 -#include <unistd.h>
405 -
406 #include "paxinc.h"
407 #include "seccomp-bpf.h"
408 -#include "security.h"
409
410 #ifdef __linux__
411
412
413 diff --git a/security.h b/security.h
414 index ef2e82a..65e1ad5 100644
415 --- a/security.h
416 +++ b/security.h
417 @@ -9,8 +9,6 @@
418 #ifndef _PAX_SECURITY_H
419 #define _PAX_SECURITY_H
420
421 -#include <stdbool.h>
422 -
423 /* Whether to enable features that significantly impact speed. */
424 #ifdef SLOW_SECURITY
425 # define USE_SLOW_SECURITY 1
426
427 diff --git a/xfuncs.c b/xfuncs.c
428 index a68756b..cd73dfa 100644
429 --- a/xfuncs.c
430 +++ b/xfuncs.c
431 @@ -6,14 +6,7 @@
432 * Copyright 2004-2012 Mike Frysinger - <vapier@g.o>
433 */
434
435 -#include <errno.h>
436 -#include <stdbool.h>
437 -#include <stddef.h>
438 -#include <stdlib.h>
439 -#include <string.h>
440 -
441 #include "paxinc.h"
442 -#include "xfuncs.h"
443
444 char *xstrdup(const char *s)
445 {
446
447 diff --git a/xfuncs.h b/xfuncs.h
448 index 5781d61..61577ec 100644
449 --- a/xfuncs.h
450 +++ b/xfuncs.h
451 @@ -9,8 +9,6 @@
452 #ifndef __XFUNCS_H__
453 #define __XFUNCS_H__
454
455 -#include <stddef.h>
456 -
457 char *xstrdup(const char *s);
458 void *xmalloc(size_t size);
459 void *xzalloc(size_t size);