Defer call to sudo_nonunix_groupcheck_cleanup() until after we have

closed the sudoers sources.  From Quest sudo.
This commit is contained in:
Todd C. Miller
2010-06-25 10:05:51 -04:00
parent 8f58fd36bb
commit 189b43fed3

View File

@@ -381,11 +381,6 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
}
}
#ifdef USING_NONUNIX_GROUPS
/* Finished with the groupcheck code */
sudo_nonunix_groupcheck_cleanup();
#endif
if (safe_cmnd == NULL)
safe_cmnd = estrdup(user_cmnd);
@@ -534,6 +529,11 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
nss->close(nss);
}
#ifdef USING_NONUNIX_GROUPS
/* Finished with the groupcheck code */
sudo_nonunix_groupcheck_cleanup();
#endif
if (ISSET(sudo_mode, (MODE_VALIDATE|MODE_CHECK|MODE_LIST)))
goto done;
@@ -1139,6 +1139,9 @@ cleanup(int gotsignal)
tq_foreach_fwd(snl, nss)
nss->close(nss);
}
#ifdef USING_NONUNIX_GROUPS
sudo_nonunix_groupcheck_cleanup();
#endif
sudo_endpwent();
sudo_endgrent();
}