There is no longer a reason for the plugin to init the debug subsystem

itself.  It will always be initialized by the front-end if needed.
This commit is contained in:
Todd C. Miller
2014-09-08 16:24:32 -06:00
parent 0f735f6581
commit e20475922d
5 changed files with 32 additions and 128 deletions

View File

@@ -569,8 +569,6 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
struct iolog_details details;
char pathbuf[PATH_MAX], sessid[7];
char *tofree = NULL;
char * const *cur;
const char *debug_flags = NULL;
size_t len;
int i, rval = -1;
debug_decl(sudoers_io_open, SUDO_DEBUG_PLUGIN)
@@ -589,16 +587,6 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
sudo_setpwent();
sudo_setgrent();
/*
* Check for debug flags in settings list.
*/
for (cur = settings; *cur != NULL; cur++) {
if (strncmp(*cur, "debug_flags=", sizeof("debug_flags=") - 1) == 0)
debug_flags = *cur + sizeof("debug_flags=") - 1;
}
if (debug_flags != NULL)
sudo_debug_init(NULL, debug_flags);
/*
* Pull iolog settings out of command_info.
*/

View File

@@ -88,7 +88,6 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
struct sudoers_policy_open_info *info = v;
char * const *cur;
const char *p, *errstr, *groups = NULL;
const char *debug_flags = NULL;
const char *remhost = NULL;
int flags = 0;
debug_decl(sudoers_policy_deserialize_info, SUDO_DEBUG_PLUGIN)
@@ -153,10 +152,6 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
}
continue;
}
if (MATCHES(*cur, "debug_flags=")) {
debug_flags = *cur + sizeof("debug_flags=") - 1;
continue;
}
if (MATCHES(*cur, "runas_user=")) {
*runas_user = *cur + sizeof("runas_user=") - 1;
sudo_user.flags |= RUNAS_USER_SPECIFIED;
@@ -367,14 +362,11 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
user_umask = umask(SUDO_UMASK);
umask(user_umask);
/* Setup debugging if indicated. */
if (debug_flags != NULL) {
sudo_debug_init(NULL, debug_flags);
for (cur = info->settings; *cur != NULL; cur++)
sudo_debug_printf(SUDO_DEBUG_INFO, "settings: %s", *cur);
for (cur = info->user_info; *cur != NULL; cur++)
sudo_debug_printf(SUDO_DEBUG_INFO, "user_info: %s", *cur);
}
/* Settings and user info debug. */
for (cur = info->settings; *cur != NULL; cur++)
sudo_debug_printf(SUDO_DEBUG_INFO, "settings: %s", *cur);
for (cur = info->user_info; *cur != NULL; cur++)
sudo_debug_printf(SUDO_DEBUG_INFO, "user_info: %s", *cur);
#undef MATCHES
debug_return_int(flags);