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.
This commit is contained in:
Todd C. Miller
2020-05-18 06:47:04 -06:00
parent d85d370c63
commit dd88460800
201 changed files with 171 additions and 771 deletions

View File

@@ -18,17 +18,13 @@
#include "config.h" #include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
# include <stdbool.h> # include <stdbool.h>
#else #else
# include "compat/stdbool.h" # include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */ #endif /* HAVE_STDBOOL_H */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -42,8 +41,6 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <pwd.h>
#include <grp.h>
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -39,7 +38,6 @@
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <time.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -37,8 +36,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <pwd.h>
#include <grp.h>
#include <limits.h> #include <limits.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -34,8 +34,6 @@
#ifndef HAVE_ARC4RANDOM #ifndef HAVE_ARC4RANDOM
#include <sys/types.h>
#include <sys/time.h>
#ifdef HAVE_SYS_RANDOM_H #ifdef HAVE_SYS_RANDOM_H
# include <sys/random.h> # include <sys/random.h>
#endif #endif

View File

@@ -25,7 +25,6 @@
#ifndef HAVE_ARC4RANDOM_BUF #ifndef HAVE_ARC4RANDOM_BUF
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(HAVE_STDINT_H) #if defined(HAVE_STDINT_H)
# include <stdint.h> # include <stdint.h>

View File

@@ -27,7 +27,6 @@
#ifndef HAVE_ARC4RANDOM_UNIFORM #ifndef HAVE_ARC4RANDOM_UNIFORM
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(HAVE_STDINT_H) #if defined(HAVE_STDINT_H)
# include <stdint.h> # include <stdint.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <termios.h> #include <termios.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -26,12 +26,10 @@
#ifndef HAVE_CLOSEFROM #ifndef HAVE_CLOSEFROM
#include <sys/types.h> #include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <unistd.h>
#ifdef HAVE_PSTAT_GETPROC #ifdef HAVE_PSTAT_GETPROC
# include <sys/pstat.h> # include <sys/pstat.h>
#else #else

View File

@@ -23,23 +23,13 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.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 */
#if defined(HAVE_STDINT_H) #if defined(HAVE_STDINT_H)
# include <stdint.h> # include <stdint.h>
#elif defined(HAVE_INTTYPES_H) #elif defined(HAVE_INTTYPES_H)
# include <inttypes.h> # include <inttypes.h>
#endif #endif
#include <unistd.h> #include <unistd.h>
#include <fcntl.h>
#include <errno.h> #include <errno.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -23,9 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
@@ -33,8 +30,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h>
#include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <gcrypt.h> #include <gcrypt.h>

View File

@@ -23,18 +23,7 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.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 <fcntl.h>
#include <errno.h> #include <errno.h>
#include <openssl/sha.h> #include <openssl/sha.h>

View File

@@ -25,8 +25,6 @@
#ifndef HAVE_DUP3 #ifndef HAVE_DUP3
#include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -23,25 +23,11 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */
#ifdef HAVE_STRING_H
# include <string.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif /* HAVE_STRINGS_H */
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <poll.h> #include <poll.h>
#include <time.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -31,13 +31,7 @@
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
# include <sys/select.h> # include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */ #endif /* HAVE_SYS_SELECT_H */
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */
@@ -45,8 +39,6 @@
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <time.h> #include <time.h>
#include <unistd.h>
#include <errno.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -24,8 +24,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -25,8 +25,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -99,9 +99,6 @@
#ifndef HAVE_FNMATCH #ifndef HAVE_FNMATCH
#include <sys/types.h>
#include <stdio.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -25,8 +25,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -37,7 +37,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -37,7 +37,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
@@ -45,8 +44,8 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h>
#include <dirent.h> #include <dirent.h>
#include <limits.h>
#include "sudo_compat.h" #include "sudo_compat.h"
@@ -133,7 +132,7 @@ sudo_getcwd(char *pt, size_t size)
* path to the beginning of the buffer, but it's always * path to the beginning of the buffer, but it's always
* been that way and stuff would probably break. * been that way and stuff would probably break.
*/ */
bcopy(bpt, pt, ept - bpt); memcpy(pt, bpt, ept - bpt);
free(up); free(up);
return pt; return pt;
} }
@@ -183,7 +182,7 @@ sudo_getcwd(char *pt, size_t size)
goto notfound; goto notfound;
if (ISDOT(dp)) if (ISDOT(dp))
continue; continue;
bcopy(dp->d_name, bup, NAMLEN(dp) + 1); memcpy(bup, dp->d_name, NAMLEN(dp) + 1);
/* Save the first error for later. */ /* Save the first error for later. */
if (lstat(up, &s)) { if (lstat(up, &s)) {
@@ -216,13 +215,13 @@ sudo_getcwd(char *pt, size_t size)
pt = npt; pt = npt;
bpt = pt + off; bpt = pt + off;
ept = pt + ptsize; ept = pt + ptsize;
bcopy(bpt, ept - len, len); memcpy(ept - len, bpt, len);
bpt = ept - len; bpt = ept - len;
} }
if (!first) if (!first)
*--bpt = '/'; *--bpt = '/';
bpt -= NAMLEN(dp); bpt -= NAMLEN(dp);
bcopy(dp->d_name, bpt, NAMLEN(dp)); memcpy(bpt, dp->d_name, NAMLEN(dp));
(void)closedir(dir); (void)closedir(dir);
/* Truncate any file name. */ /* Truncate any file name. */

View File

@@ -25,8 +25,6 @@
#ifndef HAVE_GETDELIM #ifndef HAVE_GETDELIM
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -24,8 +24,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -59,8 +59,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -23,13 +23,8 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h> #include <time.h>
#include <errno.h>
#if defined(__MACH__) && !defined(HAVE_CLOCK_GETTIME) #if defined(__MACH__) && !defined(HAVE_CLOCK_GETTIME)
# include <mach/mach.h> # include <mach/mach.h>

View File

@@ -23,13 +23,9 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <errno.h>
#define DEFAULT_TEXT_DOMAIN "sudo" #define DEFAULT_TEXT_DOMAIN "sudo"
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */

View File

@@ -23,9 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <grp.h> #include <grp.h>

View File

@@ -56,7 +56,6 @@
#ifndef HAVE_GLOB #ifndef HAVE_GLOB
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -26,8 +26,6 @@
#ifndef HAVE_ISBLANK #ifndef HAVE_ISBLANK
#include <sys/types.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#undef isblank #undef isblank

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -37,10 +36,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h>
#include <stdarg.h>
#include <time.h>
#include <ctype.h>
#define DEFAULT_TEXT_DOMAIN "sudo" #define DEFAULT_TEXT_DOMAIN "sudo"
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */

View File

@@ -23,9 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
@@ -32,7 +30,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -28,7 +28,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
@@ -41,7 +40,6 @@
#else #else
# include "compat/stdbool.h" # include "compat/stdbool.h"
#endif #endif
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -28,9 +28,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <syslog.h> #include <syslog.h>

View File

@@ -28,9 +28,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <syslog.h> #include <syslog.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stddef.h> #include <stddef.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -41,8 +40,6 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <pwd.h>
#include <grp.h>
#define DEFAULT_TEXT_DOMAIN "sudo" #define DEFAULT_TEXT_DOMAIN "sudo"
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */

View File

@@ -24,9 +24,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>

View File

@@ -24,9 +24,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>

View File

@@ -26,8 +26,6 @@
#if !defined(HAVE_MKSTEMPS) || !defined(HAVE_MKDTEMP) #if !defined(HAVE_MKSTEMPS) || !defined(HAVE_MKDTEMP)
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
@@ -50,7 +48,6 @@
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include <time.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_rand.h" #include "sudo_rand.h"

View File

@@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -33,8 +32,6 @@
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */
#include <ctype.h> #include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
# include <stdbool.h> # include <stdbool.h>
#else #else

View File

@@ -25,8 +25,6 @@
#ifndef HAVE_PIPE2 #ifndef HAVE_PIPE2
#include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -30,9 +30,6 @@
#ifndef HAVE_PW_DUP #ifndef HAVE_PW_DUP
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -26,7 +26,6 @@
#ifndef HAVE_REALLOCARRAY #ifndef HAVE_REALLOCARRAY
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(HAVE_STDINT_H) #if defined(HAVE_STDINT_H)
# include <stdint.h> # include <stdint.h>

View File

@@ -6,7 +6,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -6,7 +6,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -10,14 +10,11 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -27,11 +26,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_fatal.h" #include "sudo_fatal.h"

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -27,11 +26,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -18,16 +18,10 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#include <string.h> #include <string.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -27,11 +26,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_fatal.h" #include "sudo_fatal.h"

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -27,11 +26,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_conf.h" #include "sudo_conf.h"

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -27,11 +26,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
@@ -28,11 +27,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_fatal.h" #include "sudo_fatal.h"

View File

@@ -18,7 +18,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@@ -28,11 +27,6 @@
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif
#include <errno.h> #include <errno.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -18,8 +18,6 @@
#include "config.h" #include "config.h"
#include <sys/types.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_debug.h" #include "sudo_debug.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -23,17 +23,13 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h>
#include <errno.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -24,8 +24,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <grp.h> #include <grp.h>

View File

@@ -32,9 +32,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */

View File

@@ -25,11 +25,7 @@
#ifndef HAVE_SIG2STR #ifndef HAVE_SIG2STR
#include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */

View File

@@ -47,7 +47,6 @@
!defined(HAVE_VASPRINTF) || !defined(HAVE_ASPRINTF) || \ !defined(HAVE_VASPRINTF) || !defined(HAVE_ASPRINTF) || \
defined(PREFER_PORTABLE_SNPRINTF) defined(PREFER_PORTABLE_SNPRINTF)
#include <sys/types.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h> #include <errno.h>

View File

@@ -25,11 +25,7 @@
#ifndef HAVE_STR2SIG #ifndef HAVE_STR2SIG
#include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */

View File

@@ -28,7 +28,6 @@
#ifndef HAVE_STRLCAT #ifndef HAVE_STRLCAT
#include <sys/types.h>
#include <string.h> #include <string.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -28,7 +28,7 @@
#ifndef HAVE_STRLCPY #ifndef HAVE_STRLCPY
#include <sys/types.h> #include <string.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -27,8 +27,6 @@
#ifndef HAVE_STRNDUP #ifndef HAVE_STRNDUP
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>

View File

@@ -25,9 +25,6 @@
#ifndef HAVE_STRSIGNAL #ifndef HAVE_STRSIGNAL
#include <sys/types.h>
#include <stdio.h>
#include <signal.h> #include <signal.h>
#define DEFAULT_TEXT_DOMAIN "sudo" #define DEFAULT_TEXT_DOMAIN "sudo"

View File

@@ -23,13 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <grp.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_debug.h" #include "sudo_debug.h"
#include "sudo_util.h" #include "sudo_util.h"

View File

@@ -23,10 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */

View File

@@ -23,15 +23,8 @@
#include <config.h> #include <config.h>
#include <sys/types.h> #include <sys/types.h> /* for id_t */
#include <stdio.h>
#include <stdlib.h>
#if defined(HAVE_STDINT_H)
# include <stdint.h>
#elif defined(HAVE_INTTYPES_H)
# include <inttypes.h>
#endif
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
# include <stdbool.h> # include <stdbool.h>
#else #else

View File

@@ -23,10 +23,8 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>

View File

@@ -23,19 +23,8 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <limits.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 */
#define DEFAULT_TEXT_DOMAIN "sudo" #define DEFAULT_TEXT_DOMAIN "sudo"
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -23,9 +23,7 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <termios.h> /* for struct winsize on HP-UX */ #include <termios.h> /* for struct winsize on HP-UX */

View File

@@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -25,10 +25,8 @@
#if !defined(HAVE_FUTIMENS) || !defined(HAVE_UTIMENSAT) #if !defined(HAVE_FUTIMENS) || !defined(HAVE_UTIMENSAT)
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <stdio.h>
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#if !defined(HAVE_UTIMES) || defined(HAVE_FUTIME) #if !defined(HAVE_UTIMES) || defined(HAVE_FUTIME)

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(HAVE_STDINT_H) #if defined(HAVE_STDINT_H)
# include <stdint.h> # include <stdint.h>

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
@@ -42,8 +41,6 @@
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <time.h> #include <time.h>

View File

@@ -27,7 +27,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
@@ -38,7 +37,6 @@
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <pwd.h>
#include <grp.h> #include <grp.h>
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -23,7 +23,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
@@ -40,12 +39,9 @@
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h> #include <unistd.h>
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h>
#include <grp.h> #include <grp.h>
#include <pwd.h>
#include "sudo_plugin.h" #include "sudo_plugin.h"
#include "sudo_compat.h" #include "sudo_compat.h"

View File

@@ -21,8 +21,6 @@
* PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com * PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
*/ */
#include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@@ -32,7 +30,6 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <pwd.h>
#include "sudo_plugin.h" #include "sudo_plugin.h"

View File

@@ -19,8 +19,6 @@
#ifndef PYTHON_TESTHELPERS #ifndef PYTHON_TESTHELPERS
#define PYTHON_TESTHELPERS #define PYTHON_TESTHELPERS
#include <sys/wait.h>
#include "iohelpers.h" #include "iohelpers.h"
#include "../pyhelpers.h" #include "../pyhelpers.h"

View File

@@ -19,7 +19,6 @@
#ifndef SUDO_PYTHON_DEBUG_H #ifndef SUDO_PYTHON_DEBUG_H
#define SUDO_PYTHON_DEBUG_H #define SUDO_PYTHON_DEBUG_H
#include <sys/types.h>
#include "sudo_debug.h" #include "sudo_debug.h"
/* /*

View File

@@ -23,10 +23,10 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -41,12 +41,10 @@
# include <strings.h> # include <strings.h>
#endif /* HAVE_STRINGS_H */ #endif /* HAVE_STRINGS_H */
#include <unistd.h> #include <unistd.h>
#include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <stdarg.h>
#include <pathnames.h> #include <pathnames.h>
#include "sudo_compat.h" #include "sudo_compat.h"

Some files were not shown because too many files have changed in this diff Show More