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 03:36:57
Message-Id: 1674901114.f8287200aec0ca33ef07fafcdd5aef0aa6eb1306.sam@gentoo
1 commit: f8287200aec0ca33ef07fafcdd5aef0aa6eb1306
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 28 10:15:57 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 10:18:34 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=f8287200
7
8 *: IWYU fixes
9
10 Separate from the first commit as this one was done programmatically with
11 dev-util/include-what-you-use.
12
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 dumpelf.c | 13 +++++++++++++
16 paxelf.c | 13 +++++++++++++
17 paxelf.h | 2 ++
18 paxinc.c | 7 +++++++
19 paxinc.h | 10 +++++++++-
20 paxldso.c | 17 +++++++++++++++++
21 paxldso.h | 2 ++
22 paxmacho.c | 12 ++++++++++++
23 paxmacho.h | 2 ++
24 pspax.c | 21 ++++++++++++++++++++-
25 scanelf.c | 22 ++++++++++++++++++++++
26 scanmacho.c | 19 +++++++++++++++++++
27 security.c | 13 +++++++++++++
28 xfuncs.c | 6 ++++++
29 14 files changed, 157 insertions(+), 2 deletions(-)
30
31 diff --git a/dumpelf.c b/dumpelf.c
32 index 4742a50..baa6358 100644
33 --- a/dumpelf.c
34 +++ b/dumpelf.c
35 @@ -8,7 +8,20 @@
36
37 const char argv0[] = "dumpelf";
38
39 +#include <getopt.h>
40 +#include <inttypes.h>
41 +#include <stdbool.h>
42 +#include <stdio.h>
43 +#include <stdlib.h>
44 +#include <string.h>
45 +#include <time.h>
46 +#include <unistd.h>
47 +
48 #include "paxinc.h"
49 +#include "elf.h"
50 +#include "pax_utils_version.h"
51 +#include "porting.h"
52 +#include "security.h"
53
54 /* prototypes */
55 static void dump_ehdr(const elfobj *elf, const void *ehdr);
56
57 diff --git a/paxelf.c b/paxelf.c
58 index 331f1b4..0268fa4 100644
59 --- a/paxelf.c
60 +++ b/paxelf.c
61 @@ -6,7 +6,20 @@
62 * Copyright 2005-2012 Mike Frysinger - <vapier@g.o>
63 */
64
65 +#include <fcntl.h>
66 +#include <stdint.h>
67 +#include <stdio.h>
68 +#include <stdlib.h>
69 +#include <string.h>
70 +#include <sys/mman.h>
71 +#include <sys/stat.h>
72 +#include <unistd.h>
73 +
74 #include "paxinc.h"
75 +#include "elf.h"
76 +#include "paxelf.h"
77 +#include "porting.h"
78 +#include "xfuncs.h"
79
80 /*
81 * Setup a bunch of helper functions to translate
82
83 diff --git a/paxelf.h b/paxelf.h
84 index ac41a64..31ef298 100644
85 --- a/paxelf.h
86 +++ b/paxelf.h
87 @@ -16,6 +16,8 @@
88 #include <stdio.h>
89 #include <sys/types.h>
90
91 +#include "elf.h"
92 +
93 typedef struct {
94 const void *phdr;
95 const void *shdr;
96
97 diff --git a/paxinc.c b/paxinc.c
98 index 64a3069..7dfd4ca 100644
99 --- a/paxinc.c
100 +++ b/paxinc.c
101 @@ -11,6 +11,13 @@
102 #define IN_paxinc
103 #include "paxinc.h"
104
105 +#include <alloca.h>
106 +#include <fcntl.h>
107 +#include <sys/stat.h>
108 +#include <unistd.h>
109 +
110 +#include "xfuncs.h"
111 +
112 char do_reverse_endian;
113
114 /* some of this ar code was taken from busybox */
115
116 diff --git a/paxinc.h b/paxinc.h
117 index 3dd163a..7eb6802 100644
118 --- a/paxinc.h
119 +++ b/paxinc.h
120 @@ -11,6 +11,15 @@
121 #ifndef _PAX_INC_H
122 #define _PAX_INC_H
123
124 +#include <byteswap.h>
125 +#include <errno.h>
126 +#include <stdbool.h>
127 +#include <stdio.h>
128 +#include <stdlib.h>
129 +#include <string.h>
130 +#include <sys/types.h>
131 +#include <stdint.h>
132 +
133 #include "porting.h"
134 #include "xfuncs.h"
135 #include "security.h"
136 @@ -35,7 +44,6 @@
137 #include "elf.h"
138 #include "paxelf.h"
139 #include "paxldso.h"
140 -
141 /* Mach-O love */
142 #include "macho.h"
143 #include "paxmacho.h"
144
145 diff --git a/paxldso.c b/paxldso.c
146 index ce7facd..acab364 100644
147 --- a/paxldso.c
148 +++ b/paxldso.c
149 @@ -6,7 +6,24 @@
150 * Copyright 2004-2016 Mike Frysinger - <vapier@g.o>
151 */
152
153 +#include <ctype.h>
154 +#include <fcntl.h>
155 +#include <features.h>
156 +#include <glob.h>
157 +#include <stdbool.h>
158 +#include <stdint.h>
159 +#include <stdio.h>
160 +#include <stdlib.h>
161 +#include <string.h>
162 +#include <sys/mman.h>
163 +#include <sys/stat.h>
164 +#include <unistd.h>
165 +
166 #include "paxinc.h"
167 +#include "elf.h"
168 +#include "paxelf.h"
169 +#include "paxldso.h"
170 +#include "xfuncs.h"
171
172 /*
173 * ld.so.cache logic
174
175 diff --git a/paxldso.h b/paxldso.h
176 index fd9f344..1e95851 100644
177 --- a/paxldso.h
178 +++ b/paxldso.h
179 @@ -9,6 +9,8 @@
180 #ifndef _PAX_LDSO_H
181 #define _PAX_LDSO_H
182
183 +#include <features.h>
184 +
185 #include "paxelf.h"
186 #include "porting.h"
187 #include "xfuncs.h"
188
189 diff --git a/paxmacho.c b/paxmacho.c
190 index 74f02da..fcdff4b 100644
191 --- a/paxmacho.c
192 +++ b/paxmacho.c
193 @@ -7,7 +7,19 @@
194 * 2008-2021 Fabian Groffen - <grobian@g.o>
195 */
196
197 +#include <byteswap.h>
198 +#include <fcntl.h>
199 +#include <stdint.h>
200 +#include <stdlib.h>
201 +#include <string.h>
202 +#include <sys/mman.h>
203 +#include <sys/stat.h>
204 +#include <unistd.h>
205 +
206 #include "paxinc.h"
207 +#include "macho.h"
208 +#include "paxmacho.h"
209 +#include "xfuncs.h"
210
211 /* lil' static string pool */
212 static const char STR_BE[] = "BE";
213
214 diff --git a/paxmacho.h b/paxmacho.h
215 index c32ccbb..b109af5 100644
216 --- a/paxmacho.h
217 +++ b/paxmacho.h
218 @@ -13,6 +13,8 @@
219 #define _PAX_MACHO_H
220
221 #include <stddef.h>
222 +#include <byteswap.h>
223 +#include <stdint.h>
224
225 #include "macho.h"
226
227
228 diff --git a/pspax.c b/pspax.c
229 index 6094882..1e75494 100644
230 --- a/pspax.c
231 +++ b/pspax.c
232 @@ -14,12 +14,31 @@
233
234 const char argv0[] = "pspax";
235
236 -#include "paxinc.h"
237 #include <grp.h>
238 +#include <ctype.h>
239 +#include <dirent.h>
240 +#include <fcntl.h>
241 +#include <getopt.h>
242 +#include <pwd.h>
243 +#include <stdbool.h>
244 +#include <stdint.h>
245 +#include <stdio.h>
246 +#include <stdlib.h>
247 +#include <string.h>
248 +#include <strings.h>
249 +#include <sys/stat.h>
250 +#include <unistd.h>
251 +
252 +#include "paxinc.h"
253 +#include "elf.h"
254 +#include "pax_utils_version.h"
255 +#include "paxelf.h"
256 +#include "security.h"
257
258 #ifdef WANT_SYSCAP
259 # undef _POSIX_SOURCE
260 # include <sys/capability.h>
261 +
262 # define WRAP_SYSCAP(x) x
263 #else
264 # define WRAP_SYSCAP(x)
265
266 diff --git a/scanelf.c b/scanelf.c
267 index 50497b2..ee990c9 100644
268 --- a/scanelf.c
269 +++ b/scanelf.c
270 @@ -8,7 +8,29 @@
271
272 const char argv0[] = "scanelf";
273
274 +#include <ctype.h>
275 +#include <dirent.h>
276 +#include <errno.h>
277 +#include <fcntl.h>
278 +#include <fnmatch.h>
279 +#include <getopt.h>
280 +#include <inttypes.h>
281 +#include <regex.h>
282 +#include <stdbool.h>
283 +#include <stdio.h>
284 +#include <stdlib.h>
285 +#include <string.h>
286 +#include <sys/mman.h>
287 +#include <sys/stat.h>
288 +#include <unistd.h>
289 +
290 #include "paxinc.h"
291 +#include "elf.h"
292 +#include "pax_utils_version.h"
293 +#include "paxldso.h"
294 +#include "porting.h"
295 +#include "security.h"
296 +#include "xfuncs.h"
297
298 #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
299
300
301 diff --git a/scanmacho.c b/scanmacho.c
302 index e2aa485..fa1eee1 100644
303 --- a/scanmacho.c
304 +++ b/scanmacho.c
305 @@ -11,7 +11,26 @@
306
307 const char argv0[] = "scanmacho";
308
309 +#include <dirent.h>
310 +#include <errno.h>
311 +#include <fcntl.h>
312 +#include <getopt.h>
313 +#include <stdbool.h>
314 +#include <stdint.h>
315 +#include <stdio.h>
316 +#include <stdlib.h>
317 +#include <string.h>
318 +#include <sys/mman.h>
319 +#include <sys/stat.h>
320 +#include <unistd.h>
321 +
322 #include "paxinc.h"
323 +#include "macho.h"
324 +#include "pax_utils_version.h"
325 +#include "paxmacho.h"
326 +#include "porting.h"
327 +#include "security.h"
328 +#include "xfuncs.h"
329
330 #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
331
332
333 diff --git a/security.c b/security.c
334 index 19bf78f..f1a34df 100644
335 --- a/security.c
336 +++ b/security.c
337 @@ -5,8 +5,21 @@
338 * Copyright 2015 Mike Frysinger - <vapier@g.o>
339 */
340
341 +#include <errno.h>
342 +
343 +#ifdef WANT_SECCOMP
344 +#include <linux/seccomp.h>
345 +#include <linux/securebits.h>
346 +#endif
347 +
348 +#include <sched.h>
349 +#include <stdbool.h>
350 +#include <sys/prctl.h>
351 +#include <unistd.h>
352 +
353 #include "paxinc.h"
354 #include "seccomp-bpf.h"
355 +#include "security.h"
356
357 #ifdef __linux__
358
359
360 diff --git a/xfuncs.c b/xfuncs.c
361 index cd73dfa..e912fb0 100644
362 --- a/xfuncs.c
363 +++ b/xfuncs.c
364 @@ -6,7 +6,13 @@
365 * Copyright 2004-2012 Mike Frysinger - <vapier@g.o>
366 */
367
368 +#include <errno.h>
369 +#include <stdbool.h>
370 +#include <stdlib.h>
371 +#include <string.h>
372 +
373 #include "paxinc.h"
374 +#include "xfuncs.h"
375
376 char *xstrdup(const char *s)
377 {