From 72a4e0943eb78467d49222db5f384e33b088d4a5 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 5 Jan 2012 11:48:24 -0500 Subject: [PATCH] Remove -D debug_level option. --- doc/sudo.pod | 11 +---------- src/parse_args.c | 44 +++++++++++++++++++------------------------- src/sudo.c | 1 - src/sudo.h | 1 - 4 files changed, 20 insertions(+), 37 deletions(-) diff --git a/doc/sudo.pod b/doc/sudo.pod index 092146046..d11705b90 100644 --- a/doc/sudo.pod +++ b/doc/sudo.pod @@ -26,24 +26,21 @@ sudo, sudoedit - execute a command as another user =head1 SYNOPSIS -B S<[B<-D> I]> B<-h> | B<-K> | B<-k> | B<-V> +B B<-h> | B<-K> | B<-k> | B<-V> B B<-v> [B<-AknS>] S<[B<-a> I]> -S<[B<-D> I]> S<[B<-g> I|I<#gid>]> S<[B<-p> I]> S<[B<-u> I|I<#uid>]> B B<-l[l]> [B<-AknS>] S<[B<-a> I]> -S<[B<-D> I]> S<[B<-g> I|I<#gid>]> S<[B<-p> I]> S<[B<-U> I]> S<[B<-u> I|I<#uid>]> [I] B [B<-AbEHnPS>] S<[B<-a> I]> S<[B<-C> I]> -S<[B<-D> I]> S<[B<-c> I|I<->]> S<[B<-g> I|I<#gid>]> S<[B<-p> I]> S<[B<-r> I]> S<[B<-t> I]> @@ -54,7 +51,6 @@ B [B<-AnS>] S<[B<-a> I]> S<[B<-C> I]> S<[B<-c> I|I<->]> -S<[B<-D> I]> S<[B<-g> I|I<#gid>]> S<[B<-p> I]> S<[B<-u> I|I<#uid>]> file ... @@ -158,11 +154,6 @@ argument specifies an existing user class, the command must be run as root, or the B command must be run from a shell that is already root. This option is only available on systems with BSD login classes. -=item -D I - -Enable debugging of B plugins and B itself. The I -may be a value from 1 through 9. - =item -E The B<-E> (I I) option indicates to the diff --git a/src/parse_args.c b/src/parse_args.c index 74a1d952d..7a746350f 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -74,43 +74,41 @@ static struct sudo_settings { { "login_class" }, #define ARG_DEBUG_FLAGS 2 { "debug_flags" }, -#define ARG_DEBUG_LEVEL 3 - { "debug_level" }, -#define ARG_PRESERVE_ENVIRONMENT 4 +#define ARG_PRESERVE_ENVIRONMENT 3 { "preserve_environment" }, -#define ARG_RUNAS_GROUP 5 +#define ARG_RUNAS_GROUP 4 { "runas_group" }, -#define ARG_SET_HOME 6 +#define ARG_SET_HOME 5 { "set_home" }, -#define ARG_USER_SHELL 7 +#define ARG_USER_SHELL 6 { "run_shell" }, -#define ARG_LOGIN_SHELL 8 +#define ARG_LOGIN_SHELL 7 { "login_shell" }, -#define ARG_IGNORE_TICKET 9 +#define ARG_IGNORE_TICKET 8 { "ignore_ticket" }, -#define ARG_PROMPT 10 +#define ARG_PROMPT 9 { "prompt" }, -#define ARG_SELINUX_ROLE 11 +#define ARG_SELINUX_ROLE 10 { "selinux_role" }, -#define ARG_SELINUX_TYPE 12 +#define ARG_SELINUX_TYPE 11 { "selinux_type" }, -#define ARG_RUNAS_USER 13 +#define ARG_RUNAS_USER 12 { "runas_user" }, -#define ARG_PROGNAME 14 +#define ARG_PROGNAME 13 { "progname" }, -#define ARG_IMPLIED_SHELL 15 +#define ARG_IMPLIED_SHELL 14 { "implied_shell" }, -#define ARG_PRESERVE_GROUPS 16 +#define ARG_PRESERVE_GROUPS 15 { "preserve_groups" }, -#define ARG_NONINTERACTIVE 17 +#define ARG_NONINTERACTIVE 16 { "noninteractive" }, -#define ARG_SUDOEDIT 18 +#define ARG_SUDOEDIT 17 { "sudoedit" }, -#define ARG_CLOSEFROM 19 +#define ARG_CLOSEFROM 18 { "closefrom" }, -#define ARG_NET_ADDRS 20 +#define ARG_NET_ADDRS 19 { "network_addrs" }, -#define NUM_SETTINGS 21 +#define NUM_SETTINGS 20 { NULL } }; @@ -197,11 +195,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp, break; #endif case 'D': - if ((debug_level = atoi(optarg)) < 1 || debug_level > 9) { - warningx(_("the argument to -D must be between 1 and 9 inclusive")); - usage(1); - } - sudo_settings[ARG_DEBUG_LEVEL].value = optarg; + /* Ignored for backwards compatibility. */ break; case 'E': sudo_settings[ARG_PRESERVE_ENVIRONMENT].value = "true"; diff --git a/src/sudo.c b/src/sudo.c index 0cc8f8c3c..091c61c24 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -102,7 +102,6 @@ struct plugin_container policy_plugin; struct plugin_container_list io_plugins; struct user_details user_details; const char *list_user, *runas_user, *runas_group; /* extern for parse_args.c */ -int debug_level; static int sudo_mode; /* diff --git a/src/sudo.h b/src/sudo.h index 5972d5745..5a4f0b98c 100644 --- a/src/sudo.h +++ b/src/sudo.h @@ -201,7 +201,6 @@ void get_ttysize(int *rowp, int *colp); /* sudo.c */ bool exec_setup(struct command_details *details, const char *ptyname, int ptyfd); int run_command(struct command_details *details); -extern int debug_level; extern const char *list_user, *runas_user, *runas_group; extern struct user_details user_details; -- 2.40.0