From 30f7ecca10c0f36cea91c58f30d4db2f22a754d9 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 20 Jul 2016 13:36:45 -0600 Subject: [PATCH] In cb_sudoers_locale() actually set the locale in addition to storing its name. Otherwise, it won't take effect until sudoers lookup time. --- plugins/sudoers/sudoers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index d71401b0c..58b7985c7 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -1194,7 +1194,11 @@ cb_sudoers_locale(const union sudo_defs_val *sd_un) { debug_decl(cb_sudoers_locale, SUDOERS_DEBUG_PLUGIN) - debug_return_bool(sudoers_initlocale(NULL, sd_un->str)); + if (sudoers_initlocale(NULL, sd_un->str)) { + if (setlocale(LC_ALL, sd_un->str) != NULL) + debug_return_bool(true); + } + debug_return_bool(false); } /* -- 2.40.0