The sudoers plugin now defines its own list of debugging subsystem names
and defines.
This commit is contained in:
@@ -214,7 +214,7 @@ env_init(char * const envp[])
|
||||
{
|
||||
char * const *ep;
|
||||
size_t len;
|
||||
debug_decl(env_init, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(env_init, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
if (envp == NULL) {
|
||||
/* Reset to initial state but keep a pointer to what we allocated. */
|
||||
@@ -348,7 +348,7 @@ static int
|
||||
sudo_putenv(char *str, bool dupcheck, bool overwrite)
|
||||
{
|
||||
int rval;
|
||||
debug_decl(sudo_putenv, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(sudo_putenv, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_putenv: %s", str);
|
||||
|
||||
@@ -373,7 +373,7 @@ sudo_setenv2(const char *var, const char *val, bool dupcheck, bool overwrite)
|
||||
char *estring;
|
||||
size_t esize;
|
||||
int rval = -1;
|
||||
debug_decl(sudo_setenv2, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(sudo_setenv2, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
esize = strlen(var) + 1 + strlen(val) + 1;
|
||||
estring = sudo_emalloc(esize);
|
||||
@@ -488,7 +488,7 @@ int
|
||||
sudo_unsetenv(const char *name)
|
||||
{
|
||||
int rval;
|
||||
debug_decl(sudo_unsetenv, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(sudo_unsetenv, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_unsetenv: %s", name);
|
||||
|
||||
@@ -528,7 +528,7 @@ char *
|
||||
sudo_getenv(const char *name)
|
||||
{
|
||||
char *val;
|
||||
debug_decl(sudo_getenv, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(sudo_getenv, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_getenv: %s", name);
|
||||
|
||||
@@ -546,7 +546,7 @@ matches_env_list(const char *var, struct list_members *list, bool *full_match)
|
||||
{
|
||||
struct list_member *cur;
|
||||
bool match = false;
|
||||
debug_decl(matches_env_list, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(matches_env_list, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
SLIST_FOREACH(cur, list, entries) {
|
||||
size_t sep_pos, len = strlen(cur->value);
|
||||
@@ -579,7 +579,7 @@ static bool
|
||||
matches_env_delete(const char *var)
|
||||
{
|
||||
bool full_match; /* unused */
|
||||
debug_decl(matches_env_delete, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(matches_env_delete, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
/* Skip anything listed in env_delete. */
|
||||
debug_return_bool(matches_env_list(var, &def_env_delete, &full_match));
|
||||
@@ -594,7 +594,7 @@ static int
|
||||
matches_env_check(const char *var, bool *full_match)
|
||||
{
|
||||
int keepit = -1;
|
||||
debug_decl(matches_env_check, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(matches_env_check, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
/* Skip anything listed in env_check that includes '/' or '%'. */
|
||||
if (matches_env_list(var, &def_env_check, full_match)) {
|
||||
@@ -613,7 +613,7 @@ static bool
|
||||
matches_env_keep(const char *var, bool *full_match)
|
||||
{
|
||||
bool keepit = false;
|
||||
debug_decl(matches_env_keep, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(matches_env_keep, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
/* Preserve SHELL variable for "sudo -s". */
|
||||
if (ISSET(sudo_mode, MODE_SHELL) && strncmp(var, "SHELL=", 6) == 0) {
|
||||
@@ -634,7 +634,7 @@ env_should_delete(const char *var)
|
||||
const char *cp;
|
||||
int delete_it;
|
||||
bool full_match = false;
|
||||
debug_decl(env_should_delete, SUDO_DEBUG_ENV, sudoers_debug_instance);
|
||||
debug_decl(env_should_delete, SUDOERS_DEBUG_ENV, sudoers_debug_instance);
|
||||
|
||||
/* Skip variables with values beginning with () (bash functions) */
|
||||
if ((cp = strchr(var, '=')) != NULL) {
|
||||
@@ -664,7 +664,7 @@ env_should_keep(const char *var)
|
||||
int keepit;
|
||||
bool full_match = false;
|
||||
const char *cp;
|
||||
debug_decl(env_should_keep, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(env_should_keep, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
keepit = matches_env_check(var, &full_match);
|
||||
if (keepit == -1)
|
||||
@@ -694,7 +694,7 @@ env_merge(char * const envp[])
|
||||
{
|
||||
char * const *ep;
|
||||
bool rval = true;
|
||||
debug_decl(env_merge, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(env_merge, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
for (ep = envp; *ep != NULL; ep++) {
|
||||
/* XXX - avoid checking value here, should only check name */
|
||||
@@ -759,7 +759,7 @@ rebuild_env(void)
|
||||
char idbuf[MAX_UID_T_LEN + 1];
|
||||
unsigned int didvar;
|
||||
bool reset_home = false;
|
||||
debug_decl(rebuild_env, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(rebuild_env, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
/*
|
||||
* Either clean out the environment or reset to a safe default.
|
||||
@@ -985,7 +985,7 @@ insert_env_vars(char * const envp[])
|
||||
{
|
||||
char * const *ep;
|
||||
bool rval = true;
|
||||
debug_decl(insert_env_vars, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(insert_env_vars, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
/* Add user-specified environment variables. */
|
||||
if (envp != NULL) {
|
||||
@@ -1013,7 +1013,7 @@ validate_env_vars(char * const env_vars[])
|
||||
char *eq, *bad = NULL;
|
||||
size_t len, blen = 0, bsize = 0;
|
||||
bool okvar, rval = true;
|
||||
debug_decl(validate_env_vars, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(validate_env_vars, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
if (env_vars == NULL)
|
||||
debug_return_bool(true); /* nothing to do */
|
||||
@@ -1075,7 +1075,7 @@ read_env_file(const char *path, int overwrite)
|
||||
bool rval = true;
|
||||
char *cp, *var, *val, *line = NULL;
|
||||
size_t var_len, val_len, linesize = 0;
|
||||
debug_decl(read_env_file, SUDO_DEBUG_ENV, sudoers_debug_instance)
|
||||
debug_decl(read_env_file, SUDOERS_DEBUG_ENV, sudoers_debug_instance)
|
||||
|
||||
if ((fp = fopen(path, "r")) == NULL) {
|
||||
if (errno != ENOENT)
|
||||
|
Reference in New Issue
Block a user