From e257f2c9e32610e53b5d58a242487b1d3c63a0f9 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 20 Jul 2016 15:52:32 -0600 Subject: [PATCH] Set the warn/fatal locale helper function in sudoers_policy_init() so warning messages during sudoers loading are displayed in the user's own locale. --- plugins/sudoers/sudoers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index b02aa1962..62bff2dae 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -187,6 +187,7 @@ sudoers_policy_init(void *info, char * const envp[]) * Uses the C locale unless another is specified in sudoers. */ sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale); + sudo_warn_set_locale_func(sudoers_warn_setlocale); TAILQ_FOREACH_SAFE(nss, snl, entries, nss_next) { if (nss->open(nss) == 0 && nss->parse(nss) == 0) { sources++; @@ -246,6 +247,7 @@ cleanup: rval = -1; /* Restore user's locale. */ + sudo_warn_set_locale_func(NULL); sudoers_setlocale(oldlocale, NULL); debug_return_int(rval); -- 2.40.0