From 5d31be96a7d4046d01478b2b0d8d8da9f062610d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 23 Jul 2018 10:36:08 -0600 Subject: [PATCH] Add missing aix_restoreauthdb() call to match the aix_setauthdb() added in b8a011be9af7. Fixes issues on AIX where local users/groups may not be resolved when some NIS/AD/LDAP is used for users. --- src/sudo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sudo.c b/src/sudo.c index d8d80c324..f560c938d 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -525,6 +525,9 @@ get_user_info(struct user_details *ud) aix_setauthdb(IDtouser(ud->uid), NULL); #endif pw = getpwuid(ud->uid); +#ifdef HAVE_SETAUTHDB + aix_restoreauthdb(); +#endif if (pw == NULL) sudo_fatalx(U_("unknown uid %u: who are you?"), (unsigned int)ud->uid); @@ -820,11 +823,11 @@ command_info_to_details(char * const info[], struct command_details *details) aix_setauthdb(IDtouser(details->euid), NULL); #endif details->pw = getpwuid(details->euid); - if (details->pw != NULL && (details->pw = pw_dup(details->pw)) == NULL) - sudo_fatalx(U_("%s: %s"), __func__, U_("unable to allocate memory")); #ifdef HAVE_SETAUTHDB aix_restoreauthdb(); #endif + if (details->pw != NULL && (details->pw = pw_dup(details->pw)) == NULL) + sudo_fatalx(U_("%s: %s"), __func__, U_("unable to allocate memory")); #ifdef HAVE_SELINUX if (details->selinux_role != NULL && is_selinux_enabled() > 0) -- 2.40.0