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.
This commit is contained in:
Todd C. Miller
2018-07-23 10:36:08 -06:00
parent e7daff062f
commit 5d31be96a7

View File

@@ -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)