diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2020-05-18 06:47:04 -0600 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2020-05-18 06:47:04 -0600 |
commit | 8e729fc1ec50d0adbdfcf2b54084b9a5cd6bf063 (patch) | |
tree | efe4b51b3a26aecee534ed55650b2ddad947acac /src | |
parent | 6bb26e3054c44ecce12ac70dff00ee98a3570c57 (diff) | |
download | sudo-8e729fc1ec50d0adbdfcf2b54084b9a5cd6bf063.tar.gz |
We no longer need to include headers we don't use for sudo*.h files.
Previously we needed to include headers required by the various
sudo*h files. Now those files are more self-sufficient and we
should only include headers needed by code in the various .c files.
Diffstat (limited to 'src')
-rw-r--r-- | src/conversation.c | 1 | ||||
-rw-r--r-- | src/copy_file.c | 3 | ||||
-rw-r--r-- | src/env_hooks.c | 3 | ||||
-rw-r--r-- | src/exec.c | 2 | ||||
-rw-r--r-- | src/exec_common.c | 3 | ||||
-rw-r--r-- | src/exec_nopty.c | 1 | ||||
-rw-r--r-- | src/get_pty.c | 3 | ||||
-rw-r--r-- | src/hooks.c | 3 | ||||
-rw-r--r-- | src/limits.c | 3 | ||||
-rw-r--r-- | src/load_plugins.c | 2 | ||||
-rw-r--r-- | src/openbsd.c | 11 | ||||
-rw-r--r-- | src/parse_args.c | 5 | ||||
-rw-r--r-- | src/preload.c | 1 | ||||
-rw-r--r-- | src/preserve_fds.c | 3 | ||||
-rw-r--r-- | src/selinux.c | 1 | ||||
-rw-r--r-- | src/sesh.c | 1 | ||||
-rw-r--r-- | src/signal.c | 5 | ||||
-rw-r--r-- | src/solaris.c | 15 | ||||
-rw-r--r-- | src/sudo_edit.c | 1 | ||||
-rw-r--r-- | src/tcsetpgrp_nobg.c | 3 | ||||
-rw-r--r-- | src/tgetpass.c | 2 | ||||
-rw-r--r-- | src/utmp.c | 3 |
22 files changed, 2 insertions, 73 deletions
diff --git a/src/conversation.c b/src/conversation.c index 6bd016f1f..e94a90cd7 100644 --- a/src/conversation.c +++ b/src/conversation.c @@ -27,7 +27,6 @@ #include <config.h> -#include <sys/types.h> #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H diff --git a/src/copy_file.c b/src/copy_file.c index 9be8c86ce..0db52630f 100644 --- a/src/copy_file.c +++ b/src/copy_file.c @@ -23,9 +23,6 @@ #include <config.h> -#include <sys/types.h> - -#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> diff --git a/src/env_hooks.c b/src/env_hooks.c index ab11c10f0..494b954a7 100644 --- a/src/env_hooks.c +++ b/src/env_hooks.c @@ -23,9 +23,6 @@ #include <config.h> -#include <sys/types.h> - -#include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> diff --git a/src/exec.c b/src/exec.c index e32048ba5..2cbcf427e 100644 --- a/src/exec.c +++ b/src/exec.c @@ -23,10 +23,8 @@ #include <config.h> -#include <sys/types.h> #include <sys/resource.h> #include <sys/stat.h> -#include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> diff --git a/src/exec_common.c b/src/exec_common.c index 24bac9f55..c10e6ef72 100644 --- a/src/exec_common.c +++ b/src/exec_common.c @@ -23,7 +23,6 @@ #include <config.h> -#include <sys/types.h> #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H @@ -37,8 +36,6 @@ # include <priv.h> #endif #include <errno.h> -#include <fcntl.h> -#include <signal.h> #include "sudo.h" #include "sudo_exec.h" diff --git a/src/exec_nopty.c b/src/exec_nopty.c index 4769846c1..04fe67a38 100644 --- a/src/exec_nopty.c +++ b/src/exec_nopty.c @@ -23,7 +23,6 @@ #include <config.h> -#include <sys/types.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> diff --git a/src/get_pty.c b/src/get_pty.c index 3b727c991..9de0f7bec 100644 --- a/src/get_pty.c +++ b/src/get_pty.c @@ -24,13 +24,11 @@ #include <config.h> -#include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #ifdef HAVE_SYS_STROPTS_H #include <sys/stropts.h> #endif /* HAVE_SYS_STROPTS_H */ -#include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> @@ -42,7 +40,6 @@ #include <errno.h> #include <fcntl.h> #include <grp.h> -#include <pwd.h> #if defined(HAVE_LIBUTIL_H) # include <libutil.h> diff --git a/src/hooks.c b/src/hooks.c index 01078ae4c..f6b2350ac 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -23,8 +23,6 @@ #include <config.h> -#include <sys/types.h> -#include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> @@ -32,7 +30,6 @@ #ifdef HAVE_STRINGS_H # include <strings.h> #endif /* HAVE_STRINGS_H */ -#include <unistd.h> #include <errno.h> #include "sudo.h" diff --git a/src/limits.c b/src/limits.c index 334d2cad0..de3559682 100644 --- a/src/limits.c +++ b/src/limits.c @@ -23,10 +23,7 @@ #include <config.h> -#include <sys/types.h> #include <sys/resource.h> -#include <stdio.h> -#include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> #endif /* HAVE_STRING_H */ diff --git a/src/load_plugins.c b/src/load_plugins.c index 454a97781..08fd2b451 100644 --- a/src/load_plugins.c +++ b/src/load_plugins.c @@ -23,7 +23,6 @@ #include <config.h> -#include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> @@ -33,7 +32,6 @@ #ifdef HAVE_STRINGS_H # include <strings.h> #endif /* HAVE_STRINGS_H */ -#include <unistd.h> #include <errno.h> #include "sudo.h" diff --git a/src/openbsd.c b/src/openbsd.c index ed0d021eb..180a79102 100644 --- a/src/openbsd.c +++ b/src/openbsd.c @@ -23,17 +23,6 @@ #include <config.h> -#include <sys/types.h> -#include <stdio.h> -#include <stdlib.h> -#ifdef HAVE_STRING_H -# include <string.h> -#endif /* HAVE_STRING_H */ -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif /* HAVE_STRINGS_H */ -#include <unistd.h> - #include "sudo.h" int diff --git a/src/parse_args.c b/src/parse_args.c index 725684e4b..5fb1a49bc 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -27,8 +27,6 @@ #include <config.h> -#include <sys/types.h> - #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H @@ -37,10 +35,7 @@ #ifdef HAVE_STRINGS_H # include <strings.h> #endif /* HAVE_STRINGS_H */ -#include <unistd.h> #include <ctype.h> -#include <grp.h> -#include <pwd.h> #include <assert.h> #include <sudo_usage.h> diff --git a/src/preload.c b/src/preload.c index 524ada21c..01d30ccdd 100644 --- a/src/preload.c +++ b/src/preload.c @@ -23,7 +23,6 @@ #include <config.h> -#include <sys/types.h> #ifdef HAVE_GSS_KRB5_CCACHE_NAME # if defined(HAVE_GSSAPI_GSSAPI_KRB5_H) # include <gssapi/gssapi.h> diff --git a/src/preserve_fds.c b/src/preserve_fds.c index 4823059c1..5f39bb246 100644 --- a/src/preserve_fds.c +++ b/src/preserve_fds.c @@ -23,9 +23,6 @@ #include <config.h> -#include <sys/types.h> - -#include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> diff --git a/src/selinux.c b/src/selinux.c index 25e174865..4a0f4524c 100644 --- a/src/selinux.c +++ b/src/selinux.c @@ -35,7 +35,6 @@ #ifdef HAVE_SELINUX -#include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <stdio.h> diff --git a/src/sesh.c b/src/sesh.c index 1b2c4e99c..c9d426000 100644 --- a/src/sesh.c +++ b/src/sesh.c @@ -23,7 +23,6 @@ #include <config.h> -#include <sys/types.h> #include <sys/stat.h> #include <errno.h> #include <fcntl.h> diff --git a/src/signal.c b/src/signal.c index 80bc1d82b..867341f82 100644 --- a/src/signal.c +++ b/src/signal.c @@ -23,18 +23,13 @@ #include <config.h> -#include <sys/types.h> -#include <stdio.h> -#include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> #endif /* HAVE_STRING_H */ #ifdef HAVE_STRINGS_H # include <strings.h> #endif /* HAVE_STRINGS_H */ -#include <unistd.h> #include <errno.h> -#include <fcntl.h> #include <signal.h> #include "sudo.h" diff --git a/src/solaris.c b/src/solaris.c index d5ec8d07d..bfaccea2e 100644 --- a/src/solaris.c +++ b/src/solaris.c @@ -23,23 +23,12 @@ #include <config.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <stdio.h> -#include <stdlib.h> -#ifdef HAVE_STRING_H -# include <string.h> -#endif /* HAVE_STRING_H */ -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif /* HAVE_STRINGS_H */ -#include <unistd.h> #ifdef HAVE_PROJECT_H # include <project.h> # include <sys/task.h> +# include <errno.h> +# include <pwd.h> #endif -#include <errno.h> -#include <pwd.h> #include "sudo.h" #include "sudo_dso.h" diff --git a/src/sudo_edit.c b/src/sudo_edit.c index bff1889a0..fd677148e 100644 --- a/src/sudo_edit.c +++ b/src/sudo_edit.c @@ -26,7 +26,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> -#include <sys/socket.h> #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H diff --git a/src/tcsetpgrp_nobg.c b/src/tcsetpgrp_nobg.c index 3c888b814..59748c6dc 100644 --- a/src/tcsetpgrp_nobg.c +++ b/src/tcsetpgrp_nobg.c @@ -23,9 +23,6 @@ #include <config.h> -#include <sys/types.h> -#include <stdio.h> -#include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> #endif /* HAVE_STRING_H */ diff --git a/src/tgetpass.c b/src/tgetpass.c index 9c9de08c2..98feb892a 100644 --- a/src/tgetpass.c +++ b/src/tgetpass.c @@ -32,7 +32,6 @@ #include <config.h> -#include <sys/types.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> @@ -43,7 +42,6 @@ # include <strings.h> #endif /* HAVE_STRINGS_H */ #include <unistd.h> -#include <pwd.h> #include <errno.h> #include <signal.h> #include <fcntl.h> diff --git a/src/utmp.c b/src/utmp.c index 5fd67e799..04b90dd24 100644 --- a/src/utmp.c +++ b/src/utmp.c @@ -23,11 +23,8 @@ #include <config.h> -#include <sys/types.h> #include <sys/time.h> #include <sys/wait.h> -#include <stdio.h> -#include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> #endif /* HAVE_STRING_H */ |