aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-01-29 05:40:05 +0000
committerSam James <sam@gentoo.org>2023-01-29 05:56:32 +0000
commit755a512e6a3c2b015b8d54dc98f2f48bb9dd3971 (patch)
treedb89c83c7bf0972b80df309bb8f04bb14d08fd73
parent.github: add Alpine CI (diff)
downloadpax-utils-755a512e6a3c2b015b8d54dc98f2f48bb9dd3971.tar.gz
pax-utils-755a512e6a3c2b015b8d54dc98f2f48bb9dd3971.tar.bz2
pax-utils-755a512e6a3c2b015b8d54dc98f2f48bb9dd3971.zip
Undo IWYU fixes
I wasn't paying enough attention, it's better to just fold the needed bits into porting.h. This reverts commit ffedc60fa41d307bda28fd108e6ff1b8da1fc2ee. This reverts commit f8287200aec0ca33ef07fafcdd5aef0aa6eb1306. This reverts commit aa907a42d89ddfd5a7e64d8182a1da35277f2f6e. Bug: https://github.com/gentoo/pax-utils/pull/11#issuecomment-1407566344 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--dumpelf.c14
-rw-r--r--paxelf.c14
-rw-r--r--paxelf.h7
-rw-r--r--paxinc.c8
-rw-r--r--paxinc.h11
-rw-r--r--paxldso.c17
-rw-r--r--paxldso.h4
-rw-r--r--paxmacho.c13
-rw-r--r--paxmacho.h4
-rw-r--r--pspax.c22
-rw-r--r--scanelf.c23
-rw-r--r--scanmacho.c20
-rw-r--r--seccomp-bpf.c1
-rw-r--r--seccomp-bpf.h2
-rw-r--r--security.c13
-rw-r--r--security.h2
-rw-r--r--xfuncs.c7
-rw-r--r--xfuncs.h2
18 files changed, 2 insertions, 182 deletions
diff --git a/dumpelf.c b/dumpelf.c
index 877b0db..4742a50 100644
--- a/dumpelf.c
+++ b/dumpelf.c
@@ -8,21 +8,7 @@
const char argv0[] = "dumpelf";
-#include <getopt.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "elf.h"
-#include "pax_utils_version.h"
-#include "porting.h"
-#include "security.h"
/* prototypes */
static void dump_ehdr(const elfobj *elf, const void *ehdr);
diff --git a/paxelf.c b/paxelf.c
index b072ba0..331f1b4 100644
--- a/paxelf.c
+++ b/paxelf.c
@@ -6,21 +6,7 @@
* Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org>
*/
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "elf.h"
-#include "paxelf.h"
-#include "porting.h"
-#include "xfuncs.h"
/*
* Setup a bunch of helper functions to translate
diff --git a/paxelf.h b/paxelf.h
index 31ef298..f252969 100644
--- a/paxelf.h
+++ b/paxelf.h
@@ -11,13 +11,6 @@
#ifndef _PAX_ELF_H
#define _PAX_ELF_H
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-#include "elf.h"
-
typedef struct {
const void *phdr;
const void *shdr;
diff --git a/paxinc.c b/paxinc.c
index f87e8a6..64a3069 100644
--- a/paxinc.c
+++ b/paxinc.c
@@ -11,14 +11,6 @@
#define IN_paxinc
#include "paxinc.h"
-#include <alloca.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "xfuncs.h"
-
char do_reverse_endian;
/* some of this ar code was taken from busybox */
diff --git a/paxinc.h b/paxinc.h
index 52bbefd..3dd163a 100644
--- a/paxinc.h
+++ b/paxinc.h
@@ -11,16 +11,6 @@
#ifndef _PAX_INC_H
#define _PAX_INC_H
-#include <byteswap.h>
-#include <errno.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <stdint.h>
-
#include "porting.h"
#include "xfuncs.h"
#include "security.h"
@@ -45,6 +35,7 @@
#include "elf.h"
#include "paxelf.h"
#include "paxldso.h"
+
/* Mach-O love */
#include "macho.h"
#include "paxmacho.h"
diff --git a/paxldso.c b/paxldso.c
index d40d7ef..ce7facd 100644
--- a/paxldso.c
+++ b/paxldso.c
@@ -6,24 +6,7 @@
* Copyright 2004-2016 Mike Frysinger - <vapier@gentoo.org>
*/
-#include <ctype.h>
-#include <fcntl.h>
-#include <glob.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "elf.h"
-#include "paxelf.h"
-#include "paxldso.h"
-#include "xfuncs.h"
/*
* ld.so.cache logic
diff --git a/paxldso.h b/paxldso.h
index fd9f344..91c7eed 100644
--- a/paxldso.h
+++ b/paxldso.h
@@ -9,10 +9,6 @@
#ifndef _PAX_LDSO_H
#define _PAX_LDSO_H
-#include "paxelf.h"
-#include "porting.h"
-#include "xfuncs.h"
-
/*
* ld.so.cache logic
*/
diff --git a/paxmacho.c b/paxmacho.c
index 39db1cb..74f02da 100644
--- a/paxmacho.c
+++ b/paxmacho.c
@@ -7,20 +7,7 @@
* 2008-2021 Fabian Groffen - <grobian@gentoo.org>
*/
-#include <byteswap.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "macho.h"
-#include "paxmacho.h"
-#include "xfuncs.h"
/* lil' static string pool */
static const char STR_BE[] = "BE";
diff --git a/paxmacho.h b/paxmacho.h
index b109af5..48ac854 100644
--- a/paxmacho.h
+++ b/paxmacho.h
@@ -12,10 +12,6 @@
#ifndef _PAX_MACHO_H
#define _PAX_MACHO_H
-#include <stddef.h>
-#include <byteswap.h>
-#include <stdint.h>
-
#include "macho.h"
#define MGET(swapped, value) (swapped ? (__typeof__(value))bswap_32(value) : value)
diff --git a/pspax.c b/pspax.c
index 369ed37..6094882 100644
--- a/pspax.c
+++ b/pspax.c
@@ -14,32 +14,12 @@
const char argv0[] = "pspax";
-#include <grp.h>
-#include <ctype.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <pwd.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "elf.h"
-#include "pax_utils_version.h"
-#include "paxelf.h"
-#include "security.h"
+#include <grp.h>
#ifdef WANT_SYSCAP
# undef _POSIX_SOURCE
# include <sys/capability.h>
-
# define WRAP_SYSCAP(x) x
#else
# define WRAP_SYSCAP(x)
diff --git a/scanelf.c b/scanelf.c
index d6bb14b..50497b2 100644
--- a/scanelf.c
+++ b/scanelf.c
@@ -8,30 +8,7 @@
const char argv0[] = "scanelf";
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <fnmatch.h>
-#include <getopt.h>
-#include <inttypes.h>
-#include <regex.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "elf.h"
-#include "pax_utils_version.h"
-#include "paxldso.h"
-#include "porting.h"
-#include "security.h"
-#include "xfuncs.h"
#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
diff --git a/scanmacho.c b/scanmacho.c
index c38c5ed..e2aa485 100644
--- a/scanmacho.c
+++ b/scanmacho.c
@@ -11,27 +11,7 @@
const char argv0[] = "scanmacho";
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
#include "paxinc.h"
-#include "macho.h"
-#include "pax_utils_version.h"
-#include "paxmacho.h"
-#include "porting.h"
-#include "security.h"
-#include "xfuncs.h"
#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
diff --git a/seccomp-bpf.c b/seccomp-bpf.c
index 7c3923f..1d64172 100644
--- a/seccomp-bpf.c
+++ b/seccomp-bpf.c
@@ -11,7 +11,6 @@ const char argv0[] = "seccomp-bpf";
#include <err.h>
#include <stdio.h>
-#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
diff --git a/seccomp-bpf.h b/seccomp-bpf.h
index 21499f7..80d6d94 100644
--- a/seccomp-bpf.h
+++ b/seccomp-bpf.h
@@ -4,8 +4,6 @@
* See seccomp-bpf.c for details. */
#undef SECCOMP_BPF_AVAILABLE
-#include <stdint.h>
-
#if defined(__aarch64__)
/* AARCH64 */
#define SECCOMP_BPF_AVAILABLE
diff --git a/security.c b/security.c
index f1a34df..19bf78f 100644
--- a/security.c
+++ b/security.c
@@ -5,21 +5,8 @@
* Copyright 2015 Mike Frysinger - <vapier@gentoo.org>
*/
-#include <errno.h>
-
-#ifdef WANT_SECCOMP
-#include <linux/seccomp.h>
-#include <linux/securebits.h>
-#endif
-
-#include <sched.h>
-#include <stdbool.h>
-#include <sys/prctl.h>
-#include <unistd.h>
-
#include "paxinc.h"
#include "seccomp-bpf.h"
-#include "security.h"
#ifdef __linux__
diff --git a/security.h b/security.h
index ef2e82a..65e1ad5 100644
--- a/security.h
+++ b/security.h
@@ -9,8 +9,6 @@
#ifndef _PAX_SECURITY_H
#define _PAX_SECURITY_H
-#include <stdbool.h>
-
/* Whether to enable features that significantly impact speed. */
#ifdef SLOW_SECURITY
# define USE_SLOW_SECURITY 1
diff --git a/xfuncs.c b/xfuncs.c
index a68756b..cd73dfa 100644
--- a/xfuncs.c
+++ b/xfuncs.c
@@ -6,14 +6,7 @@
* Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org>
*/
-#include <errno.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "paxinc.h"
-#include "xfuncs.h"
char *xstrdup(const char *s)
{
diff --git a/xfuncs.h b/xfuncs.h
index 5781d61..61577ec 100644
--- a/xfuncs.h
+++ b/xfuncs.h
@@ -9,8 +9,6 @@
#ifndef __XFUNCS_H__
#define __XFUNCS_H__
-#include <stddef.h>
-
char *xstrdup(const char *s);
void *xmalloc(size_t size);
void *xzalloc(size_t size);