Move inclusion of compat headers up with the system headers.

Now that sudo_dso_public is defined in config.h we don't need sudo_compat.h
before including the compat headers.
This commit is contained in:
Todd C. Miller
2020-08-12 10:07:07 -06:00
parent 985af422d2
commit cbad17a994
14 changed files with 55 additions and 69 deletions

View File

@@ -35,6 +35,9 @@
# include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */
#include <unistd.h>
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#include "sudo_compat.h"
#include "sudo_fatal.h"
@@ -43,10 +46,6 @@
#include "sudo_util.h"
#include "sudo_plugin.h"
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
struct sudo_fatal_callback {
SLIST_ENTRY(sudo_fatal_callback) entries;
void (*func)(void);

View File

@@ -9,16 +9,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sudo_compat.h"
#include "sudo_util.h"
#ifdef HAVE_FNMATCH
# include <fnmatch.h>
#else
# include "compat/fnmatch.h"
#endif
#include "sudo_compat.h"
#include "sudo_util.h"
sudo_dso_public int main(int argc, char *argv[]);
int

View File

@@ -43,6 +43,11 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#if defined(HAVE_OPENSSL)
# include <openssl/ssl.h>
@@ -67,12 +72,6 @@
#include "hostcheck.h"
#include "logsrvd.h"
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#if defined(HAVE_OPENSSL)
# define LOGSRVD_DEFAULT_CIPHER_LST12 "HIGH:!aNULL"
# define LOGSRVD_DEFAULT_CIPHER_LST13 "TLS_AES_256_GCM_SHA384"

View File

@@ -40,6 +40,9 @@
#include <unistd.h>
#include <grp.h>
#include <pwd.h>
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#include "pathnames.h"
#include "sudo_compat.h"
@@ -52,10 +55,6 @@
#include "log_server.pb-c.h"
#include "logsrvd.h"
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#if defined(HAVE_OPENSSL)
# define DEFAULT_CA_CERT_PATH "/etc/ssl/sudo/cacert.pem"
# define DEFAULT_SERVER_CERT_PATH "/etc/ssl/sudo/certs/logsrvd_cert.pem"

View File

@@ -45,6 +45,14 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#if defined(HAVE_OPENSSL)
# include <openssl/ssl.h>
@@ -64,15 +72,6 @@
#include "log_server.pb-c.h"
#include "sendlog.h"
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#if defined(HAVE_OPENSSL)
# define TLS_HANDSHAKE_TIMEO_SEC 10
#endif

View File

@@ -37,6 +37,11 @@
#include <errno.h>
#include <pwd.h>
#include <unistd.h>
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#include "sudoers.h"
#include "sudoers_version.h"
@@ -45,12 +50,6 @@
#include "cvtsudoers.h"
#include <gram.h>
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
/*
* Globals
*/

View File

@@ -44,6 +44,9 @@
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#if defined(HAVE_OPENSSL)
# include <openssl/ssl.h>
@@ -59,10 +62,6 @@
#include "iolog_plugin.h"
#include "hostcheck.h"
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
/* Server callback may redirect to client callback for TLS. */
static void client_msg_cb(int fd, int what, void *v);
static void server_msg_cb(int fd, int what, void *v);

View File

@@ -48,13 +48,12 @@
#include <errno.h>
#include <fcntl.h>
#include <syslog.h>
#include "sudoers.h"
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#include "sudoers.h"
/* Special message for log_warning() so we know to use ngettext() */
#define INCORRECT_PASSWORD_ATTEMPT ((char *)0x01)

View File

@@ -49,16 +49,15 @@
#include <pwd.h>
#include <grp.h>
#include <errno.h>
#include "sudoers.h"
#include <gram.h>
#ifdef HAVE_FNMATCH
# include <fnmatch.h>
#else
# include "compat/fnmatch.h"
#endif /* HAVE_FNMATCH */
#include "sudoers.h"
#include <gram.h>
static struct member_list empty = TAILQ_HEAD_INITIALIZER(empty);
/*

View File

@@ -41,16 +41,15 @@
#include <dirent.h>
#include <fcntl.h>
#include <errno.h>
#include "sudoers.h"
#include <gram.h>
#ifdef HAVE_FNMATCH
# include <fnmatch.h>
#else
# include "compat/fnmatch.h"
#endif /* HAVE_FNMATCH */
#include "sudoers.h"
#include <gram.h>
#if !defined(O_EXEC) && defined(O_PATH)
# define O_EXEC O_PATH
#endif

View File

@@ -57,16 +57,15 @@
# include <selinux/selinux.h>
#endif
#include <ctype.h>
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
#include "sudoers.h"
#include "parse.h"
#include "auth/sudo_auth.h"
#include "sudo_iolog.h"
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
/*
* Prototypes
*/

View File

@@ -50,6 +50,11 @@
#endif /* HAVE_STDBOOL_H */
#include <regex.h>
#include <signal.h>
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#include "pathnames.h"
#include "sudo_compat.h"
@@ -65,12 +70,6 @@
#include "logging.h"
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
struct replay_closure {
const char *iolog_dir;
struct sudo_event_base *evbase;

View File

@@ -57,6 +57,11 @@
#include <time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#include "sudoers.h"
#include "interfaces.h"
@@ -65,12 +70,6 @@
#include "sudo_conf.h"
#include <gram.h>
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
struct sudoersfile {
TAILQ_ENTRY(sudoersfile) entries;
char *path;

View File

@@ -32,17 +32,16 @@
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <sudo_usage.h>
#include "sudo.h"
#include "sudo_lbuf.h"
#ifdef HAVE_GETOPT_LONG
# include <getopt.h>
# else
# include "compat/getopt.h"
#endif /* HAVE_GETOPT_LONG */
#include <sudo_usage.h>
#include "sudo.h"
#include "sudo_lbuf.h"
int tgetpass_flags;
/*