Instead of trying to make weak functions work on all platforms,

just use a registration function for a plugin-specific setlocale
function.  The sudoers version just wraps sudoers_setlocale().
This commit is contained in:
Todd C. Miller
2015-05-11 14:51:32 -06:00
parent fc7143760b
commit 8bc70a635c
19 changed files with 90 additions and 940 deletions

View File

@@ -228,6 +228,8 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
volatile int rval = true;
debug_decl(sudoers_policy_main, SUDOERS_DEBUG_PLUGIN)
sudo_warn_set_locale_func(sudoers_warn_setlocale);
/* Is root even allowed to run sudo? */
if (user_uid == 0 && !def_root_sudo) {
/* Not an audit event. */
@@ -553,6 +555,8 @@ done:
sudo_endpwent();
sudo_endgrent();
sudo_warn_set_locale_func(NULL);
debug_return_int(rval);
}