locale of "C".
"env_file", T_STR|T_PATH|T_BOOL,
"Path to the sudo-specific environment file: %s",
NULL,
+ }, {
+ "sudoers_locale", T_STR,
+ "Locale to use while parsing sudoers: %s",
+ NULL,
}, {
NULL, 0, NULL
}
#define I_ASKPASS 66
#define def_env_file (sudo_defs_table[67].sd_un.str)
#define I_ENV_FILE 67
+#define def_sudoers_locale (sudo_defs_table[68].sd_un.str)
+#define I_SUDOERS_LOCALE 68
enum def_tupple {
never,
env_file
T_STR|T_PATH|T_BOOL
"Path to the sudo-specific environment file: %s"
+sudoers_locale
+ T_STR
+ "Locale to use while parsing sudoers: %s"
#ifdef _PATH_SUDO_ASKPASS
def_askpass = estrdup(_PATH_SUDO_ASKPASS);
#endif
+ def_sudoers_locale = estrdup("C");
def_env_reset = TRUE;
def_set_logname = TRUE;
def_closefrom = STDERR_FILENO + 1;
cmnd_status = set_cmnd(sudo_mode);
#ifdef HAVE_SETLOCALE
- setlocale(LC_ALL, "C");
+ if (!setlocale(LC_ALL, def_sudoers_locale)) {
+ warningx("unable to set locale to \"%s\", using \"C\"",
+ def_sudoers_locale);
+ setlocale(LC_ALL, "C");
+ }
#endif
validated = FLAG_NO_USER | FLAG_NO_HOST;