Add a flag argument to sudo_conf_read() so we can decide which
bits get parsed. This lets us parse Debug statements first and init the debug subsystem early.
This commit is contained in:
@@ -19,6 +19,14 @@
|
||||
|
||||
#include "sudo_queue.h"
|
||||
|
||||
/* Flags for sudo_conf_read() */
|
||||
#define SUDO_CONF_DEBUG 0x01
|
||||
#define SUDO_CONF_PATHS 0x02
|
||||
#define SUDO_CONF_PLUGINS 0x04
|
||||
#define SUDO_CONF_SETTINGS 0x08
|
||||
#define SUDO_CONF_ALL 0x0f
|
||||
|
||||
/* Values of sudo_conf_group_source() */
|
||||
#define GROUP_SOURCE_ADAPTIVE 0
|
||||
#define GROUP_SOURCE_STATIC 1
|
||||
#define GROUP_SOURCE_DYNAMIC 2
|
||||
@@ -28,7 +36,6 @@ TAILQ_HEAD(sudo_conf_debug_file_list, sudo_debug_file);
|
||||
|
||||
struct plugin_info {
|
||||
TAILQ_ENTRY(plugin_info) entries;
|
||||
struct sudo_conf_debug_file_list debug_files;
|
||||
const char *path;
|
||||
const char *symbol_name;
|
||||
char * const * options;
|
||||
@@ -44,8 +51,8 @@ struct sudo_conf_debug {
|
||||
TAILQ_HEAD(sudo_conf_debug_list, sudo_conf_debug);
|
||||
|
||||
/* Read main sudo.conf file. */
|
||||
__dso_public void sudo_conf_read_v1(const char *conf_file);
|
||||
#define sudo_conf_read(_a) sudo_conf_read_v1((_a))
|
||||
__dso_public void sudo_conf_read_v1(const char *conf_file, int conf_types);
|
||||
#define sudo_conf_read(_a, _b) sudo_conf_read_v1((_a), (_b))
|
||||
|
||||
/* Accessor functions. */
|
||||
__dso_public const char *sudo_conf_askpass_path_v1(void);
|
||||
@@ -53,6 +60,7 @@ __dso_public const char *sudo_conf_sesh_path_v1(void);
|
||||
__dso_public const char *sudo_conf_noexec_path_v1(void);
|
||||
__dso_public const char *sudo_conf_plugin_dir_path_v1(void);
|
||||
__dso_public struct sudo_conf_debug_list *sudo_conf_debugging_v1(void);
|
||||
__dso_public struct sudo_conf_debug_file_list *sudo_conf_debug_files_v1(const char *progname);
|
||||
__dso_public struct plugin_info_list *sudo_conf_plugins_v1(void);
|
||||
__dso_public bool sudo_conf_disable_coredump_v1(void);
|
||||
__dso_public bool sudo_conf_probe_interfaces_v1(void);
|
||||
@@ -63,6 +71,7 @@ __dso_public int sudo_conf_max_groups_v1(void);
|
||||
#define sudo_conf_noexec_path() sudo_conf_noexec_path_v1()
|
||||
#define sudo_conf_plugin_dir_path() sudo_conf_plugin_dir_path_v1()
|
||||
#define sudo_conf_debugging() sudo_conf_debugging_v1()
|
||||
#define sudo_conf_debug_files(_a) sudo_conf_debug_files_v1((_a))
|
||||
#define sudo_conf_plugins() sudo_conf_plugins_v1()
|
||||
#define sudo_conf_disable_coredump() sudo_conf_disable_coredump_v1()
|
||||
#define sudo_conf_probe_interfaces() sudo_conf_probe_interfaces_v1()
|
||||
|
Reference in New Issue
Block a user