From 0b241088b3b4f0f45926daa9a4328e6c895afea7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 2 Jul 2015 09:08:28 -0600 Subject: [PATCH] There's no need to conditionalize the #include , we require a POSIX system. --- lib/util/event.c | 4 +- lib/util/event_poll.c | 4 +- lib/util/event_select.c | 4 +- lib/util/getcwd.c | 4 +- lib/util/gettime.c | 4 +- lib/util/glob.c | 4 +- lib/util/lbuf.c | 4 +- lib/util/locking.c | 4 +- lib/util/mktemp.c | 4 +- lib/util/parseln.c | 4 +- lib/util/secure_path.c | 4 +- lib/util/setgroups.c | 4 +- lib/util/sudo_conf.c | 4 +- lib/util/sudo_debug.c | 4 +- lib/util/ttysize.c | 4 +- plugins/group_file/group_file.c | 4 +- plugins/sample/sample_plugin.c | 4 +- plugins/sudoers/alias.c | 4 +- plugins/sudoers/auth/afs.c | 4 +- plugins/sudoers/auth/aix_auth.c | 4 +- plugins/sudoers/auth/bsdauth.c | 4 +- plugins/sudoers/auth/dce.c | 4 +- plugins/sudoers/auth/fwtk.c | 4 +- plugins/sudoers/auth/kerb5.c | 4 +- plugins/sudoers/auth/pam.c | 4 +- plugins/sudoers/auth/passwd.c | 4 +- plugins/sudoers/auth/rfc1938.c | 4 +- plugins/sudoers/auth/secureware.c | 4 +- plugins/sudoers/auth/securid5.c | 4 +- plugins/sudoers/auth/sia.c | 4 +- plugins/sudoers/auth/sudo_auth.c | 4 +- plugins/sudoers/check.c | 4 +- plugins/sudoers/defaults.c | 2 - plugins/sudoers/editor.c | 4 +- plugins/sudoers/env.c | 4 +- plugins/sudoers/find_path.c | 4 +- plugins/sudoers/getspwuid.c | 4 +- plugins/sudoers/goodpath.c | 4 +- plugins/sudoers/gram.c | 204 ++++++++++++++-------------- plugins/sudoers/gram.y | 4 +- plugins/sudoers/group_plugin.c | 4 +- plugins/sudoers/interfaces.c | 4 +- plugins/sudoers/iolog.c | 4 +- plugins/sudoers/ldap.c | 4 +- plugins/sudoers/logging.c | 4 +- plugins/sudoers/match.c | 4 +- plugins/sudoers/match_addr.c | 4 +- plugins/sudoers/parse.c | 4 +- plugins/sudoers/policy.c | 4 +- plugins/sudoers/pwutil.c | 4 +- plugins/sudoers/pwutil_impl.c | 4 +- plugins/sudoers/set_perms.c | 4 +- plugins/sudoers/sssd.c | 4 +- plugins/sudoers/sudo_nss.c | 4 +- plugins/sudoers/sudoers.c | 4 +- plugins/sudoers/sudoers_debug.c | 4 +- plugins/sudoers/sudoreplay.c | 4 +- plugins/sudoers/testsudoers.c | 4 +- plugins/sudoers/timestamp.c | 4 +- plugins/sudoers/toke.c | 4 +- plugins/sudoers/toke.l | 4 +- plugins/sudoers/toke_util.c | 4 +- plugins/sudoers/visudo.c | 2 - plugins/sudoers/visudo_json.c | 2 - plugins/system_group/system_group.c | 4 +- src/conversation.c | 4 +- src/exec.c | 4 +- src/exec_common.c | 4 +- src/exec_pty.c | 4 +- src/get_pty.c | 4 +- src/hooks.c | 4 +- src/load_plugins.c | 4 +- src/net_ifs.c | 4 +- src/openbsd.c | 4 +- src/parse_args.c | 4 +- src/preserve_fds.c | 4 +- src/signal.c | 4 +- src/solaris.c | 4 +- src/sudo.c | 4 +- src/sudo_edit.c | 4 +- src/sudo_noexec.c | 4 +- src/tgetpass.c | 4 +- src/ttyname.c | 4 +- src/utmp.c | 4 +- 84 files changed, 181 insertions(+), 349 deletions(-) diff --git a/lib/util/event.c b/lib/util/event.c index 0f209eb8d..703f8f243 100644 --- a/lib/util/event.c +++ b/lib/util/event.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo_compat.h" diff --git a/lib/util/event_poll.c b/lib/util/event_poll.c index e2454c003..e238c3813 100644 --- a/lib/util/event_poll.c +++ b/lib/util/event_poll.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/lib/util/event_select.c b/lib/util/event_select.c index a63d9c063..75e830775 100644 --- a/lib/util/event_select.c +++ b/lib/util/event_select.c @@ -37,9 +37,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo_compat.h" diff --git a/lib/util/getcwd.c b/lib/util/getcwd.c index 3d9d8a17c..e3eaeecc5 100644 --- a/lib/util/getcwd.c +++ b/lib/util/getcwd.c @@ -43,9 +43,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) diff --git a/lib/util/gettime.c b/lib/util/gettime.c index 8eae8047d..22191d0dc 100644 --- a/lib/util/gettime.c +++ b/lib/util/gettime.c @@ -20,9 +20,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/lib/util/glob.c b/lib/util/glob.c index 9c177e790..889d2dedc 100644 --- a/lib/util/glob.c +++ b/lib/util/glob.c @@ -65,9 +65,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #if defined(HAVE_STDINT_H) # include #elif defined(HAVE_INTTYPES_H) diff --git a/lib/util/lbuf.c b/lib/util/lbuf.c index d3411f163..0e56ba36f 100644 --- a/lib/util/lbuf.c +++ b/lib/util/lbuf.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo_compat.h" diff --git a/lib/util/locking.c b/lib/util/locking.c index 879e2b4f2..ca53cb6ac 100644 --- a/lib/util/locking.c +++ b/lib/util/locking.c @@ -33,9 +33,7 @@ # include #endif /* HAVE_STRING_H */ #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #ifdef HAVE_STDBOOL_H # include diff --git a/lib/util/mktemp.c b/lib/util/mktemp.c index 2a64cc9ca..2a71e4002 100644 --- a/lib/util/mktemp.c +++ b/lib/util/mktemp.c @@ -37,9 +37,7 @@ # include #endif /* HAVE_STRINGS_H */ #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/lib/util/parseln.c b/lib/util/parseln.c index 71486e521..1b26a3dda 100644 --- a/lib/util/parseln.c +++ b/lib/util/parseln.c @@ -26,9 +26,7 @@ # include #endif /* HAVE_STRING_H */ #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #ifdef HAVE_STDBOOL_H # include diff --git a/lib/util/secure_path.c b/lib/util/secure_path.c index ef0a0b643..aba7d30e8 100644 --- a/lib/util/secure_path.c +++ b/lib/util/secure_path.c @@ -25,9 +25,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo_compat.h" diff --git a/lib/util/setgroups.c b/lib/util/setgroups.c index 80204a503..f6978427f 100644 --- a/lib/util/setgroups.c +++ b/lib/util/setgroups.c @@ -21,9 +21,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/lib/util/sudo_conf.c b/lib/util/sudo_conf.c index efee7e70e..edb6724ff 100644 --- a/lib/util/sudo_conf.c +++ b/lib/util/sudo_conf.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/lib/util/sudo_debug.c b/lib/util/sudo_debug.c index 9c884e416..28907085f 100644 --- a/lib/util/sudo_debug.c +++ b/lib/util/sudo_debug.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/lib/util/ttysize.c b/lib/util/ttysize.c index 7a5416314..816d251df 100644 --- a/lib/util/ttysize.c +++ b/lib/util/ttysize.c @@ -22,9 +22,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/plugins/group_file/group_file.c b/plugins/group_file/group_file.c index 53bb08b25..788eb8d0c 100644 --- a/plugins/group_file/group_file.c +++ b/plugins/group_file/group_file.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sample/sample_plugin.c b/plugins/sample/sample_plugin.c index 44ff6aeef..2451c97c6 100644 --- a/plugins/sample/sample_plugin.c +++ b/plugins/sample/sample_plugin.c @@ -33,9 +33,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/alias.c b/plugins/sudoers/alias.c index 9ea70c5f3..4676a16bc 100644 --- a/plugins/sudoers/alias.c +++ b/plugins/sudoers/alias.c @@ -28,9 +28,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/auth/afs.c b/plugins/sudoers/auth/afs.c index c10913bfb..5693cb18b 100644 --- a/plugins/sudoers/auth/afs.c +++ b/plugins/sudoers/auth/afs.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/plugins/sudoers/auth/aix_auth.c b/plugins/sudoers/auth/aix_auth.c index 4b26c67e4..66a0b23e1 100644 --- a/plugins/sudoers/auth/aix_auth.c +++ b/plugins/sudoers/auth/aix_auth.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/auth/bsdauth.c b/plugins/sudoers/auth/bsdauth.c index 1c40e9348..e01b6944a 100644 --- a/plugins/sudoers/auth/bsdauth.c +++ b/plugins/sudoers/auth/bsdauth.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/auth/dce.c b/plugins/sudoers/auth/dce.c index eabc7dd00..e5966152e 100644 --- a/plugins/sudoers/auth/dce.c +++ b/plugins/sudoers/auth/dce.c @@ -46,9 +46,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/plugins/sudoers/auth/fwtk.c b/plugins/sudoers/auth/fwtk.c index 43aa279ca..73094d6c2 100644 --- a/plugins/sudoers/auth/fwtk.c +++ b/plugins/sudoers/auth/fwtk.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/plugins/sudoers/auth/kerb5.c b/plugins/sudoers/auth/kerb5.c index c8550a27a..8c7aff6f8 100644 --- a/plugins/sudoers/auth/kerb5.c +++ b/plugins/sudoers/auth/kerb5.c @@ -35,9 +35,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRING_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #ifdef HAVE_HEIMDAL diff --git a/plugins/sudoers/auth/pam.c b/plugins/sudoers/auth/pam.c index 9dee74ea9..571dbf824 100644 --- a/plugins/sudoers/auth/pam.c +++ b/plugins/sudoers/auth/pam.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/plugins/sudoers/auth/passwd.c b/plugins/sudoers/auth/passwd.c index 3e7dee699..9173ff35a 100644 --- a/plugins/sudoers/auth/passwd.c +++ b/plugins/sudoers/auth/passwd.c @@ -29,9 +29,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/auth/rfc1938.c b/plugins/sudoers/auth/rfc1938.c index 8dc7dd929..cf2e37eda 100644 --- a/plugins/sudoers/auth/rfc1938.c +++ b/plugins/sudoers/auth/rfc1938.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #if defined(HAVE_SKEY) diff --git a/plugins/sudoers/auth/secureware.c b/plugins/sudoers/auth/secureware.c index c6f326eb2..a44a3cb0d 100644 --- a/plugins/sudoers/auth/secureware.c +++ b/plugins/sudoers/auth/secureware.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #ifdef __hpux # undef MAXINT diff --git a/plugins/sudoers/auth/securid5.c b/plugins/sudoers/auth/securid5.c index 1ce73c02a..7274de0fe 100644 --- a/plugins/sudoers/auth/securid5.c +++ b/plugins/sudoers/auth/securid5.c @@ -36,9 +36,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include /* Needed for SecurID v5.0 Authentication on UNIX */ diff --git a/plugins/sudoers/auth/sia.c b/plugins/sudoers/auth/sia.c index 5d400524a..b6c757f4a 100644 --- a/plugins/sudoers/auth/sia.c +++ b/plugins/sudoers/auth/sia.c @@ -34,9 +34,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/auth/sudo_auth.c b/plugins/sudoers/auth/sudo_auth.c index 61378a166..83bd08588 100644 --- a/plugins/sudoers/auth/sudo_auth.c +++ b/plugins/sudoers/auth/sudo_auth.c @@ -29,9 +29,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/check.c b/plugins/sudoers/check.c index 24f20316c..f29b103e3 100644 --- a/plugins/sudoers/check.c +++ b/plugins/sudoers/check.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/defaults.c b/plugins/sudoers/defaults.c index 5e6b29105..58960c09d 100644 --- a/plugins/sudoers/defaults.c +++ b/plugins/sudoers/defaults.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -# ifdef HAVE_UNISTD_H #include -#endif /* HAVE_UNISTD_H */ #include #include diff --git a/plugins/sudoers/editor.c b/plugins/sudoers/editor.c index 8ffc37af3..6ef426186 100644 --- a/plugins/sudoers/editor.c +++ b/plugins/sudoers/editor.c @@ -26,9 +26,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/env.c b/plugins/sudoers/env.c index 1e7f94c16..848a7e6bf 100644 --- a/plugins/sudoers/env.c +++ b/plugins/sudoers/env.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #if defined(HAVE_STDINT_H) # include #elif defined(HAVE_INTTYPES_H) diff --git a/plugins/sudoers/find_path.c b/plugins/sudoers/find_path.c index 6c9f47aa3..1742ecea5 100644 --- a/plugins/sudoers/find_path.c +++ b/plugins/sudoers/find_path.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/getspwuid.c b/plugins/sudoers/getspwuid.c index 2615db516..38cbc4f62 100644 --- a/plugins/sudoers/getspwuid.c +++ b/plugins/sudoers/getspwuid.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #ifdef HAVE_GETSPNAM diff --git a/plugins/sudoers/goodpath.c b/plugins/sudoers/goodpath.c index 5a6839166..822a03bfc 100644 --- a/plugins/sudoers/goodpath.c +++ b/plugins/sudoers/goodpath.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/gram.c b/plugins/sudoers/gram.c index fbacdad7b..632fbea4f 100644 --- a/plugins/sudoers/gram.c +++ b/plugins/sudoers/gram.c @@ -72,9 +72,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #if defined(HAVE_STDINT_H) # include #elif defined(HAVE_INTTYPES_H) @@ -108,7 +106,7 @@ static bool add_userspec(struct member *, struct privilege *); static struct defaults *new_default(char *, char *, int); static struct member *new_member(char *, int); static struct sudo_digest *new_digest(int, const char *); -#line 75 "gram.y" +#line 73 "gram.y" #ifndef YYSTYPE_DEFINED #define YYSTYPE_DEFINED typedef union { @@ -126,7 +124,7 @@ typedef union { int tok; } YYSTYPE; #endif /* YYSTYPE_DEFINED */ -#line 129 "gram.c" +#line 127 "gram.c" #define COMMAND 257 #define ALIAS 258 #define DEFVAR 259 @@ -703,7 +701,7 @@ short *yyss; short *yysslim; YYSTYPE *yyvs; unsigned int yystacksize; -#line 852 "gram.y" +#line 850 "gram.y" void sudoerserror(const char *s) { @@ -985,7 +983,7 @@ init_parser(const char *path, bool quiet) debug_return_bool(rval); } -#line 936 "gram.c" +#line 934 "gram.c" /* allocate initial stack or double stack size, up to YYMAXDEPTH */ #if defined(__cplusplus) || defined(__STDC__) static int yygrowstack(void) @@ -1194,23 +1192,23 @@ yyreduce: switch (yyn) { case 1: -#line 167 "gram.y" +#line 165 "gram.y" { ; } break; case 5: -#line 175 "gram.y" +#line 173 "gram.y" { ; } break; case 6: -#line 178 "gram.y" +#line 176 "gram.y" { yyerrok; } break; case 7: -#line 181 "gram.y" +#line 179 "gram.y" { if (!add_userspec(yyvsp[-1].member, yyvsp[0].privilege)) { sudoerserror(N_("unable to allocate memory")); @@ -1219,31 +1217,31 @@ case 7: } break; case 8: -#line 187 "gram.y" +#line 185 "gram.y" { ; } break; case 9: -#line 190 "gram.y" +#line 188 "gram.y" { ; } break; case 10: -#line 193 "gram.y" +#line 191 "gram.y" { ; } break; case 11: -#line 196 "gram.y" +#line 194 "gram.y" { ; } break; case 12: -#line 199 "gram.y" +#line 197 "gram.y" { if (!add_defaults(DEFAULTS, NULL, yyvsp[0].defaults)) { sudoerserror(N_("unable to allocate memory")); @@ -1252,7 +1250,7 @@ case 12: } break; case 13: -#line 205 "gram.y" +#line 203 "gram.y" { if (!add_defaults(DEFAULTS_USER, yyvsp[-1].member, yyvsp[0].defaults)) { sudoerserror(N_("unable to allocate memory")); @@ -1261,7 +1259,7 @@ case 13: } break; case 14: -#line 211 "gram.y" +#line 209 "gram.y" { if (!add_defaults(DEFAULTS_RUNAS, yyvsp[-1].member, yyvsp[0].defaults)) { sudoerserror(N_("unable to allocate memory")); @@ -1270,7 +1268,7 @@ case 14: } break; case 15: -#line 217 "gram.y" +#line 215 "gram.y" { if (!add_defaults(DEFAULTS_HOST, yyvsp[-1].member, yyvsp[0].defaults)) { sudoerserror(N_("unable to allocate memory")); @@ -1279,7 +1277,7 @@ case 15: } break; case 16: -#line 223 "gram.y" +#line 221 "gram.y" { if (!add_defaults(DEFAULTS_CMND, yyvsp[-1].member, yyvsp[0].defaults)) { sudoerserror(N_("unable to allocate memory")); @@ -1288,14 +1286,14 @@ case 16: } break; case 18: -#line 232 "gram.y" +#line 230 "gram.y" { HLTQ_CONCAT(yyvsp[-2].defaults, yyvsp[0].defaults, entries); yyval.defaults = yyvsp[-2].defaults; } break; case 19: -#line 238 "gram.y" +#line 236 "gram.y" { yyval.defaults = new_default(yyvsp[0].string, NULL, true); if (yyval.defaults == NULL) { @@ -1305,7 +1303,7 @@ case 19: } break; case 20: -#line 245 "gram.y" +#line 243 "gram.y" { yyval.defaults = new_default(yyvsp[0].string, NULL, false); if (yyval.defaults == NULL) { @@ -1315,7 +1313,7 @@ case 20: } break; case 21: -#line 252 "gram.y" +#line 250 "gram.y" { yyval.defaults = new_default(yyvsp[-2].string, yyvsp[0].string, true); if (yyval.defaults == NULL) { @@ -1325,7 +1323,7 @@ case 21: } break; case 22: -#line 259 "gram.y" +#line 257 "gram.y" { yyval.defaults = new_default(yyvsp[-2].string, yyvsp[0].string, '+'); if (yyval.defaults == NULL) { @@ -1335,7 +1333,7 @@ case 22: } break; case 23: -#line 266 "gram.y" +#line 264 "gram.y" { yyval.defaults = new_default(yyvsp[-2].string, yyvsp[0].string, '-'); if (yyval.defaults == NULL) { @@ -1345,14 +1343,14 @@ case 23: } break; case 25: -#line 276 "gram.y" +#line 274 "gram.y" { HLTQ_CONCAT(yyvsp[-2].privilege, yyvsp[0].privilege, entries); yyval.privilege = yyvsp[-2].privilege; } break; case 26: -#line 282 "gram.y" +#line 280 "gram.y" { struct privilege *p = calloc(1, sizeof(*p)); if (p == NULL) { @@ -1366,21 +1364,21 @@ case 26: } break; case 27: -#line 295 "gram.y" +#line 293 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = false; } break; case 28: -#line 299 "gram.y" +#line 297 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = true; } break; case 29: -#line 305 "gram.y" +#line 303 "gram.y" { yyval.member = new_member(yyvsp[0].string, ALIAS); if (yyval.member == NULL) { @@ -1390,7 +1388,7 @@ case 29: } break; case 30: -#line 312 "gram.y" +#line 310 "gram.y" { yyval.member = new_member(NULL, ALL); if (yyval.member == NULL) { @@ -1400,7 +1398,7 @@ case 30: } break; case 31: -#line 319 "gram.y" +#line 317 "gram.y" { yyval.member = new_member(yyvsp[0].string, NETGROUP); if (yyval.member == NULL) { @@ -1410,7 +1408,7 @@ case 31: } break; case 32: -#line 326 "gram.y" +#line 324 "gram.y" { yyval.member = new_member(yyvsp[0].string, NTWKADDR); if (yyval.member == NULL) { @@ -1420,7 +1418,7 @@ case 32: } break; case 33: -#line 333 "gram.y" +#line 331 "gram.y" { yyval.member = new_member(yyvsp[0].string, WORD); if (yyval.member == NULL) { @@ -1430,7 +1428,7 @@ case 33: } break; case 35: -#line 343 "gram.y" +#line 341 "gram.y" { struct cmndspec *prev; prev = HLTQ_LAST(yyvsp[-2].cmndspec, cmndspec, entries); @@ -1474,7 +1472,7 @@ case 35: } break; case 36: -#line 386 "gram.y" +#line 384 "gram.y" { struct cmndspec *cs = calloc(1, sizeof(*cs)); if (cs == NULL) { @@ -1523,7 +1521,7 @@ case 36: } break; case 37: -#line 434 "gram.y" +#line 432 "gram.y" { yyval.digest = new_digest(SUDO_DIGEST_SHA224, yyvsp[0].string); if (yyval.digest == NULL) { @@ -1533,7 +1531,7 @@ case 37: } break; case 38: -#line 441 "gram.y" +#line 439 "gram.y" { yyval.digest = new_digest(SUDO_DIGEST_SHA256, yyvsp[0].string); if (yyval.digest == NULL) { @@ -1543,7 +1541,7 @@ case 38: } break; case 39: -#line 448 "gram.y" +#line 446 "gram.y" { yyval.digest = new_digest(SUDO_DIGEST_SHA384, yyvsp[0].string); if (yyval.digest == NULL) { @@ -1553,7 +1551,7 @@ case 39: } break; case 40: -#line 455 "gram.y" +#line 453 "gram.y" { yyval.digest = new_digest(SUDO_DIGEST_SHA512, yyvsp[0].string); if (yyval.digest == NULL) { @@ -1563,13 +1561,13 @@ case 40: } break; case 41: -#line 464 "gram.y" +#line 462 "gram.y" { yyval.member = yyvsp[0].member; } break; case 42: -#line 467 "gram.y" +#line 465 "gram.y" { if (yyvsp[0].member->type != COMMAND) { sudoerserror(N_("a digest requires a path name")); @@ -1581,127 +1579,127 @@ case 42: } break; case 43: -#line 478 "gram.y" +#line 476 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = false; } break; case 44: -#line 482 "gram.y" +#line 480 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = true; } break; case 45: -#line 488 "gram.y" +#line 486 "gram.y" { yyval.string = yyvsp[0].string; } break; case 46: -#line 493 "gram.y" +#line 491 "gram.y" { yyval.string = yyvsp[0].string; } break; case 47: -#line 498 "gram.y" +#line 496 "gram.y" { yyval.seinfo.role = NULL; yyval.seinfo.type = NULL; } break; case 48: -#line 502 "gram.y" +#line 500 "gram.y" { yyval.seinfo.role = yyvsp[0].string; yyval.seinfo.type = NULL; } break; case 49: -#line 506 "gram.y" +#line 504 "gram.y" { yyval.seinfo.type = yyvsp[0].string; yyval.seinfo.role = NULL; } break; case 50: -#line 510 "gram.y" +#line 508 "gram.y" { yyval.seinfo.role = yyvsp[-1].string; yyval.seinfo.type = yyvsp[0].string; } break; case 51: -#line 514 "gram.y" +#line 512 "gram.y" { yyval.seinfo.type = yyvsp[-1].string; yyval.seinfo.role = yyvsp[0].string; } break; case 52: -#line 520 "gram.y" +#line 518 "gram.y" { yyval.string = yyvsp[0].string; } break; case 53: -#line 524 "gram.y" +#line 522 "gram.y" { yyval.string = yyvsp[0].string; } break; case 54: -#line 529 "gram.y" +#line 527 "gram.y" { yyval.privinfo.privs = NULL; yyval.privinfo.limitprivs = NULL; } break; case 55: -#line 533 "gram.y" +#line 531 "gram.y" { yyval.privinfo.privs = yyvsp[0].string; yyval.privinfo.limitprivs = NULL; } break; case 56: -#line 537 "gram.y" +#line 535 "gram.y" { yyval.privinfo.privs = NULL; yyval.privinfo.limitprivs = yyvsp[0].string; } break; case 57: -#line 541 "gram.y" +#line 539 "gram.y" { yyval.privinfo.privs = yyvsp[-1].string; yyval.privinfo.limitprivs = yyvsp[0].string; } break; case 58: -#line 545 "gram.y" +#line 543 "gram.y" { yyval.privinfo.limitprivs = yyvsp[-1].string; yyval.privinfo.privs = yyvsp[0].string; } break; case 59: -#line 551 "gram.y" +#line 549 "gram.y" { yyval.runas = NULL; } break; case 60: -#line 554 "gram.y" +#line 552 "gram.y" { yyval.runas = yyvsp[-1].runas; } break; case 61: -#line 559 "gram.y" +#line 557 "gram.y" { yyval.runas = calloc(1, sizeof(struct runascontainer)); if (yyval.runas != NULL) { @@ -1719,7 +1717,7 @@ case 61: } break; case 62: -#line 574 "gram.y" +#line 572 "gram.y" { yyval.runas = calloc(1, sizeof(struct runascontainer)); if (yyval.runas == NULL) { @@ -1731,7 +1729,7 @@ case 62: } break; case 63: -#line 583 "gram.y" +#line 581 "gram.y" { yyval.runas = calloc(1, sizeof(struct runascontainer)); if (yyval.runas == NULL) { @@ -1743,7 +1741,7 @@ case 63: } break; case 64: -#line 592 "gram.y" +#line 590 "gram.y" { yyval.runas = calloc(1, sizeof(struct runascontainer)); if (yyval.runas == NULL) { @@ -1755,7 +1753,7 @@ case 64: } break; case 65: -#line 601 "gram.y" +#line 599 "gram.y" { yyval.runas = calloc(1, sizeof(struct runascontainer)); if (yyval.runas != NULL) { @@ -1773,86 +1771,86 @@ case 65: } break; case 66: -#line 618 "gram.y" +#line 616 "gram.y" { yyval.tag.log_input = yyval.tag.log_output = yyval.tag.noexec = yyval.tag.nopasswd = yyval.tag.send_mail = yyval.tag.setenv = UNSPEC; } break; case 67: -#line 622 "gram.y" +#line 620 "gram.y" { yyval.tag.nopasswd = true; } break; case 68: -#line 625 "gram.y" +#line 623 "gram.y" { yyval.tag.nopasswd = false; } break; case 69: -#line 628 "gram.y" +#line 626 "gram.y" { yyval.tag.noexec = true; } break; case 70: -#line 631 "gram.y" +#line 629 "gram.y" { yyval.tag.noexec = false; } break; case 71: -#line 634 "gram.y" +#line 632 "gram.y" { yyval.tag.setenv = true; } break; case 72: -#line 637 "gram.y" +#line 635 "gram.y" { yyval.tag.setenv = false; } break; case 73: -#line 640 "gram.y" +#line 638 "gram.y" { yyval.tag.log_input = true; } break; case 74: -#line 643 "gram.y" +#line 641 "gram.y" { yyval.tag.log_input = false; } break; case 75: -#line 646 "gram.y" +#line 644 "gram.y" { yyval.tag.log_output = true; } break; case 76: -#line 649 "gram.y" +#line 647 "gram.y" { yyval.tag.log_output = false; } break; case 77: -#line 652 "gram.y" +#line 650 "gram.y" { yyval.tag.send_mail = true; } break; case 78: -#line 655 "gram.y" +#line 653 "gram.y" { yyval.tag.send_mail = false; } break; case 79: -#line 660 "gram.y" +#line 658 "gram.y" { yyval.member = new_member(NULL, ALL); if (yyval.member == NULL) { @@ -1862,7 +1860,7 @@ case 79: } break; case 80: -#line 667 "gram.y" +#line 665 "gram.y" { yyval.member = new_member(yyvsp[0].string, ALIAS); if (yyval.member == NULL) { @@ -1872,7 +1870,7 @@ case 80: } break; case 81: -#line 674 "gram.y" +#line 672 "gram.y" { struct sudo_command *c = calloc(1, sizeof(*c)); if (c == NULL) { @@ -1890,7 +1888,7 @@ case 81: } break; case 84: -#line 695 "gram.y" +#line 693 "gram.y" { const char *s; if ((s = alias_add(yyvsp[-2].string, HOSTALIAS, yyvsp[0].member)) != NULL) { @@ -1900,14 +1898,14 @@ case 84: } break; case 86: -#line 705 "gram.y" +#line 703 "gram.y" { HLTQ_CONCAT(yyvsp[-2].member, yyvsp[0].member, entries); yyval.member = yyvsp[-2].member; } break; case 89: -#line 715 "gram.y" +#line 713 "gram.y" { const char *s; if ((s = alias_add(yyvsp[-2].string, CMNDALIAS, yyvsp[0].member)) != NULL) { @@ -1917,14 +1915,14 @@ case 89: } break; case 91: -#line 725 "gram.y" +#line 723 "gram.y" { HLTQ_CONCAT(yyvsp[-2].member, yyvsp[0].member, entries); yyval.member = yyvsp[-2].member; } break; case 94: -#line 735 "gram.y" +#line 733 "gram.y" { const char *s; if ((s = alias_add(yyvsp[-2].string, RUNASALIAS, yyvsp[0].member)) != NULL) { @@ -1934,7 +1932,7 @@ case 94: } break; case 97: -#line 748 "gram.y" +#line 746 "gram.y" { const char *s; if ((s = alias_add(yyvsp[-2].string, USERALIAS, yyvsp[0].member)) != NULL) { @@ -1944,28 +1942,28 @@ case 97: } break; case 99: -#line 758 "gram.y" +#line 756 "gram.y" { HLTQ_CONCAT(yyvsp[-2].member, yyvsp[0].member, entries); yyval.member = yyvsp[-2].member; } break; case 100: -#line 764 "gram.y" +#line 762 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = false; } break; case 101: -#line 768 "gram.y" +#line 766 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = true; } break; case 102: -#line 774 "gram.y" +#line 772 "gram.y" { yyval.member = new_member(yyvsp[0].string, ALIAS); if (yyval.member == NULL) { @@ -1975,7 +1973,7 @@ case 102: } break; case 103: -#line 781 "gram.y" +#line 779 "gram.y" { yyval.member = new_member(NULL, ALL); if (yyval.member == NULL) { @@ -1985,7 +1983,7 @@ case 103: } break; case 104: -#line 788 "gram.y" +#line 786 "gram.y" { yyval.member = new_member(yyvsp[0].string, NETGROUP); if (yyval.member == NULL) { @@ -1995,7 +1993,7 @@ case 104: } break; case 105: -#line 795 "gram.y" +#line 793 "gram.y" { yyval.member = new_member(yyvsp[0].string, USERGROUP); if (yyval.member == NULL) { @@ -2005,7 +2003,7 @@ case 105: } break; case 106: -#line 802 "gram.y" +#line 800 "gram.y" { yyval.member = new_member(yyvsp[0].string, WORD); if (yyval.member == NULL) { @@ -2015,28 +2013,28 @@ case 106: } break; case 108: -#line 812 "gram.y" +#line 810 "gram.y" { HLTQ_CONCAT(yyvsp[-2].member, yyvsp[0].member, entries); yyval.member = yyvsp[-2].member; } break; case 109: -#line 818 "gram.y" +#line 816 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = false; } break; case 110: -#line 822 "gram.y" +#line 820 "gram.y" { yyval.member = yyvsp[0].member; yyval.member->negated = true; } break; case 111: -#line 828 "gram.y" +#line 826 "gram.y" { yyval.member = new_member(yyvsp[0].string, ALIAS); if (yyval.member == NULL) { @@ -2046,7 +2044,7 @@ case 111: } break; case 112: -#line 835 "gram.y" +#line 833 "gram.y" { yyval.member = new_member(NULL, ALL); if (yyval.member == NULL) { @@ -2056,7 +2054,7 @@ case 112: } break; case 113: -#line 842 "gram.y" +#line 840 "gram.y" { yyval.member = new_member(yyvsp[0].string, WORD); if (yyval.member == NULL) { @@ -2065,7 +2063,7 @@ case 113: } } break; -#line 2016 "gram.c" +#line 2014 "gram.c" } yyssp -= yym; yystate = *yyssp; diff --git a/plugins/sudoers/gram.y b/plugins/sudoers/gram.y index ad336f475..0b9a249f0 100644 --- a/plugins/sudoers/gram.y +++ b/plugins/sudoers/gram.y @@ -34,9 +34,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #if defined(HAVE_STDINT_H) # include #elif defined(HAVE_INTTYPES_H) diff --git a/plugins/sudoers/group_plugin.c b/plugins/sudoers/group_plugin.c index 36d15ffc1..467eaa4cd 100644 --- a/plugins/sudoers/group_plugin.c +++ b/plugins/sudoers/group_plugin.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/interfaces.c b/plugins/sudoers/interfaces.c index 47a62b424..45019a4c8 100644 --- a/plugins/sudoers/interfaces.c +++ b/plugins/sudoers/interfaces.c @@ -26,9 +26,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/iolog.c b/plugins/sudoers/iolog.c index 6fd214984..9a4f97c78 100644 --- a/plugins/sudoers/iolog.c +++ b/plugins/sudoers/iolog.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c index 540e13146..887092a3b 100644 --- a/plugins/sudoers/ldap.c +++ b/plugins/sudoers/ldap.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 8ac570a51..05f579866 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -36,9 +36,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_NL_LANGINFO # include #endif /* HAVE_NL_LANGINFO */ diff --git a/plugins/sudoers/match.c b/plugins/sudoers/match.c index 2db363517..f69d2f32a 100644 --- a/plugins/sudoers/match.c +++ b/plugins/sudoers/match.c @@ -41,9 +41,7 @@ #elif defined(HAVE_INTTYPES_H) # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifndef SUDOERS_NAME_MATCH # ifdef HAVE_GLOB # include diff --git a/plugins/sudoers/match_addr.c b/plugins/sudoers/match_addr.c index 21de1a08e..91ffa857f 100644 --- a/plugins/sudoers/match_addr.c +++ b/plugins/sudoers/match_addr.c @@ -33,9 +33,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index f6ddff364..793bbcf4a 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c index 5854ab7a6..59fc1fa03 100644 --- a/plugins/sudoers/policy.c +++ b/plugins/sudoers/policy.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/pwutil.c b/plugins/sudoers/pwutil.c index 9c516a0ee..6164494fe 100644 --- a/plugins/sudoers/pwutil.c +++ b/plugins/sudoers/pwutil.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_SETAUTHDB # include #endif /* HAVE_SETAUTHDB */ diff --git a/plugins/sudoers/pwutil_impl.c b/plugins/sudoers/pwutil_impl.c index 65fcf3a90..03e61df48 100644 --- a/plugins/sudoers/pwutil_impl.c +++ b/plugins/sudoers/pwutil_impl.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/set_perms.c b/plugins/sudoers/set_perms.c index 7fb44fee8..af6cdc36a 100644 --- a/plugins/sudoers/set_perms.c +++ b/plugins/sudoers/set_perms.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef _AIX # include #endif diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c index 5c9cf1d0c..10234ed6b 100644 --- a/plugins/sudoers/sssd.c +++ b/plugins/sudoers/sssd.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/sudo_nss.c b/plugins/sudoers/sudo_nss.c index e3d7e77b4..4f7f27aec 100644 --- a/plugins/sudoers/sudo_nss.c +++ b/plugins/sudoers/sudo_nss.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 05d450fbd..b6b9c7f21 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -36,9 +36,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/plugins/sudoers/sudoers_debug.c b/plugins/sudoers/sudoers_debug.c index 3d3b7aa16..9dc8727fd 100644 --- a/plugins/sudoers/sudoers_debug.c +++ b/plugins/sudoers/sudoers_debug.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index 5526da1d5..7fb8eacae 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/testsudoers.c b/plugins/sudoers/testsudoers.c index e213d0cc2..20124a0f0 100644 --- a/plugins/sudoers/testsudoers.c +++ b/plugins/sudoers/testsudoers.c @@ -34,9 +34,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_NETGROUP_H # include #endif /* HAVE_NETGROUP_H */ diff --git a/plugins/sudoers/timestamp.c b/plugins/sudoers/timestamp.c index 3161a594d..42abcd1e6 100644 --- a/plugins/sudoers/timestamp.c +++ b/plugins/sudoers/timestamp.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c index eab4a0544..3c0ed3c40 100644 --- a/plugins/sudoers/toke.c +++ b/plugins/sudoers/toke.c @@ -1974,9 +1974,7 @@ char *yytext; #elif defined(HAVE_INTTYPES_H) # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) diff --git a/plugins/sudoers/toke.l b/plugins/sudoers/toke.l index 8781aebd6..cea07e846 100644 --- a/plugins/sudoers/toke.l +++ b/plugins/sudoers/toke.l @@ -40,9 +40,7 @@ #elif defined(HAVE_INTTYPES_H) # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) diff --git a/plugins/sudoers/toke_util.c b/plugins/sudoers/toke_util.c index 52a0d7673..87a56dd3b 100644 --- a/plugins/sudoers/toke_util.c +++ b/plugins/sudoers/toke_util.c @@ -33,9 +33,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudoers.h" diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index 04fd5bc6f..a8ea9cf3f 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -46,9 +46,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H #include -#endif /* HAVE_UNISTD_H */ #include #include #include diff --git a/plugins/sudoers/visudo_json.c b/plugins/sudoers/visudo_json.c index cbecbf8a6..9ae2751e0 100644 --- a/plugins/sudoers/visudo_json.c +++ b/plugins/sudoers/visudo_json.c @@ -25,9 +25,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H #include -#endif /* HAVE_UNISTD_H */ #include #include diff --git a/plugins/system_group/system_group.c b/plugins/system_group/system_group.c index 728662798..6093fc324 100644 --- a/plugins/system_group/system_group.c +++ b/plugins/system_group/system_group.c @@ -32,9 +32,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/conversation.c b/src/conversation.c index 7035f6c40..cb752b883 100644 --- a/src/conversation.c +++ b/src/conversation.c @@ -29,9 +29,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo.h" diff --git a/src/exec.c b/src/exec.c index c41dc3a1c..b518bae71 100644 --- a/src/exec.c +++ b/src/exec.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/src/exec_common.c b/src/exec_common.c index 32e99fe52..f29b550bc 100644 --- a/src/exec_common.c +++ b/src/exec_common.c @@ -25,9 +25,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_PRIV_SET # include #endif diff --git a/src/exec_pty.c b/src/exec_pty.c index 58cd53c46..947dd7126 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -29,9 +29,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif diff --git a/src/get_pty.c b/src/get_pty.c index e72db2c83..5ecd4cdb2 100644 --- a/src/get_pty.c +++ b/src/get_pty.c @@ -31,9 +31,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/hooks.c b/src/hooks.c index c64b69b20..ae918b314 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -25,9 +25,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo.h" diff --git a/src/load_plugins.c b/src/load_plugins.c index 95bdd830d..d26a2b0cf 100644 --- a/src/load_plugins.c +++ b/src/load_plugins.c @@ -26,9 +26,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include "sudo.h" diff --git a/src/net_ifs.c b/src/net_ifs.c index f5d39e71f..12961adf9 100644 --- a/src/net_ifs.c +++ b/src/net_ifs.c @@ -50,9 +50,7 @@ struct rtentry; #else # include "compat/stdbool.h" #endif /* HAVE_STDBOOL_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #ifdef _ISC diff --git a/src/openbsd.c b/src/openbsd.c index fb889e83c..97213fca4 100644 --- a/src/openbsd.c +++ b/src/openbsd.c @@ -25,9 +25,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include "sudo.h" diff --git a/src/parse_args.c b/src/parse_args.c index 1d7da7639..28372f5bb 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -30,9 +30,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/preserve_fds.c b/src/preserve_fds.c index 00c73e29d..cbdd5e8e5 100644 --- a/src/preserve_fds.c +++ b/src/preserve_fds.c @@ -24,9 +24,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/signal.c b/src/signal.c index f1c875dc5..888492fad 100644 --- a/src/signal.c +++ b/src/signal.c @@ -25,9 +25,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include diff --git a/src/solaris.c b/src/solaris.c index ec5e9ca9b..20b3846b2 100644 --- a/src/solaris.c +++ b/src/solaris.c @@ -26,9 +26,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_PROJECT_H # include # include diff --git a/src/sudo.c b/src/sudo.c index 30a17931a..3be4f1837 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -34,9 +34,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/sudo_edit.c b/src/sudo_edit.c index 5c170405f..66460b060 100644 --- a/src/sudo_edit.c +++ b/src/sudo_edit.c @@ -29,9 +29,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/sudo_noexec.c b/src/sudo_noexec.c index 33ac2968d..615f98b69 100644 --- a/src/sudo_noexec.c +++ b/src/sudo_noexec.c @@ -20,9 +20,7 @@ #include #include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_SPAWN_H #include #endif diff --git a/src/tgetpass.c b/src/tgetpass.c index 57a70cc2a..4786996ab 100644 --- a/src/tgetpass.c +++ b/src/tgetpass.c @@ -35,9 +35,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/ttyname.c b/src/ttyname.c index fd56f0105..fa24fbbd9 100644 --- a/src/ttyname.c +++ b/src/ttyname.c @@ -37,9 +37,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #include #include #include diff --git a/src/utmp.c b/src/utmp.c index 0dd4de75d..7929a04fa 100644 --- a/src/utmp.c +++ b/src/utmp.c @@ -27,9 +27,7 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ +#include #ifdef TIME_WITH_SYS_TIME # include #endif -- 2.40.0