From: Todd C. Miller Date: Fri, 25 Jun 2010 13:57:58 +0000 (-0400) Subject: Defer call to sudo_nonunix_groupcheck_cleanup() until after we have X-Git-Tag: SUDO_1_7_3~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f179c46cdbc58544f6bbfb3fe4979f83d9f0fc4e;p=sudo Defer call to sudo_nonunix_groupcheck_cleanup() until after we have closed the sudoers sources. From Quest sudo. --HG-- branch : 1.7 --- diff --git a/sudo.c b/sudo.c index d17233d7a..92262d290 100644 --- a/sudo.c +++ b/sudo.c @@ -358,11 +358,6 @@ main(argc, argv, envp) } } -#ifdef USING_NONUNIX_GROUPS - /* Finished with the groupcheck code */ - sudo_nonunix_groupcheck_cleanup(); -#endif - if (safe_cmnd == NULL) safe_cmnd = estrdup(user_cmnd); @@ -478,6 +473,11 @@ main(argc, argv, envp) tq_foreach_fwd(snl, nss) nss->close(nss); +#ifdef USING_NONUNIX_GROUPS + /* Finished with the groupcheck code */ + sudo_nonunix_groupcheck_cleanup(); +#endif + /* Deferred exit due to sudo_ldap_close() */ if (ISSET(sudo_mode, (MODE_VALIDATE|MODE_CHECK|MODE_LIST))) exit(rc); @@ -1300,6 +1300,9 @@ cleanup(gotsignal) tq_foreach_fwd(snl, nss) nss->close(nss); } +#ifdef USING_NONUNIX_GROUPS + sudo_nonunix_groupcheck_cleanup(); +#endif sudo_endpwent(); sudo_endgrent(); #ifdef _PATH_SUDO_IO_LOGDIR