From: Todd C. Miller Date: Tue, 11 Dec 2001 22:57:44 +0000 (+0000) Subject: Convert environment options to use the new LIST type and add a new one, X-Git-Tag: SUDO_1_6_4~139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93971de65416515b64c6c078e07595f8a03b1999;p=sudo Convert environment options to use the new LIST type and add a new one, env_check that only deletes if the sanity check fails. --- diff --git a/def_data.c b/def_data.c index 7c757a08c..0e6383a67 100644 --- a/def_data.c +++ b/def_data.c @@ -1,13 +1,13 @@ struct sudo_defs_types sudo_defs_table[] = { { - "syslog_ifac", NULL, - "NULL" + "syslog_ifac", T_UINT, + NULL }, { - "syslog_igoodpri", NULL, - "NULL" + "syslog_igoodpri", T_UINT, + NULL }, { - "syslog_ibadpri", NULL, - "NULL" + "syslog_ibadpri", T_UINT, + NULL }, { "syslog", T_LOGFAC|T_BOOL, "Syslog facility if syslog is being used for logging: %s" @@ -153,17 +153,20 @@ struct sudo_defs_types sudo_defs_table[] = { "editor", T_STR|T_PATH, "Path to the editor for use by visudo: %s" }, { - "env_delete", T_STR|T_BOOL, - "Environment variables to remove: %s" + "env_check", T_LIST|T_BOOL, + "Environment variables to check for sanity:" }, { - "env_keep", T_STR|T_BOOL, - "Environment variables to preserve: %s" + "env_delete", T_LIST|T_BOOL, + "Environment variables to remove:" }, { - "listpw_i", NULL, - "NULL" + "env_keep", T_LIST|T_BOOL, + "Environment variables to preserve:" }, { - "verifypw_i", NULL, - "NULL" + "listpw_i", T_UINT, + NULL + }, { + "verifypw_i", T_UINT, + NULL }, { "listpw", T_PWFLAG, "When to require a password for 'list' pseudocommand: %s" diff --git a/def_data.h b/def_data.h index 1b9fafb8d..652989456 100644 --- a/def_data.h +++ b/def_data.h @@ -49,9 +49,10 @@ #define I_RUNAS_DEFAULT 48 #define I_SECURE_PATH 49 #define I_EDITOR 50 -#define I_ENV_DELETE 51 -#define I_ENV_KEEP 52 -#define I_LISTPW_I 53 -#define I_VERIFYPW_I 54 -#define I_LISTPW 55 -#define I_VERIFYPW 56 +#define I_ENV_CHECK 51 +#define I_ENV_DELETE 52 +#define I_ENV_KEEP 53 +#define I_LISTPW_I 54 +#define I_VERIFYPW_I 55 +#define I_LISTPW 56 +#define I_VERIFYPW 57 diff --git a/def_data.in b/def_data.in index 47a80a264..262720039 100644 --- a/def_data.in +++ b/def_data.in @@ -159,12 +159,15 @@ secure_path editor T_STR|T_PATH "Path to the editor for use by visudo: %s" +env_check + T_LIST|T_BOOL + "Environment variables to check for sanity:" env_delete - T_STR|T_BOOL - "Environment variables to remove: %s" + T_LIST|T_BOOL + "Environment variables to remove:" env_keep - T_STR|T_BOOL - "Environment variables to preserve: %s" + T_LIST|T_BOOL + "Environment variables to preserve:" listpw_i T_UINT NULL