From: Todd C. Miller Date: Sat, 13 Sep 2008 18:09:28 +0000 (+0000) Subject: Set locale to system default except for during sudoers parse. X-Git-Tag: SUDO_1_7_0~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=508295b1f66b4ed7ba8f833c06e63b9d86eb8fa7;p=sudo Set locale to system default except for during sudoers parse. --- diff --git a/sudo.c b/sudo.c index e43f8bdab..685d04dea 100644 --- a/sudo.c +++ b/sudo.c @@ -178,7 +178,7 @@ main(argc, argv, envp) struct sudo_nss *nss; #ifdef HAVE_SETLOCALE - setlocale(LC_ALL, "C"); + setlocale(LC_ALL, ""); #endif Argv = argv; @@ -325,6 +325,10 @@ main(argc, argv, envp) cmnd_status = set_cmnd(sudo_mode); +#ifdef HAVE_SETLOCALE + setlocale(LC_ALL, "C"); +#endif + validated = FLAG_NO_USER | FLAG_NO_HOST; tq_foreach_fwd(snl, nss) { validated = nss->lookup(nss, validated, pwflag); @@ -336,6 +340,10 @@ main(argc, argv, envp) if (safe_cmnd == NULL) safe_cmnd = estrdup(user_cmnd); +#ifdef HAVE_SETLOCALE + setlocale(LC_ALL, ""); +#endif + /* If only a group was specified, set runas_pw based on invoking user. */ if (runas_pw == NULL) set_runaspw(user_name);