From: Todd C. Miller Date: Thu, 5 Aug 2010 13:45:21 +0000 (-0400) Subject: Move calls to sudo_endgrent() and sudo_endpwent() to be after X-Git-Tag: SUDO_1_7_5~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8732bfe66e49d56d158a659e0224b5e1da2e0bd7;p=sudo Move calls to sudo_endgrent() and sudo_endpwent() to be after set_perms(), which may do passwd or group lookups. --HG-- branch : 1.7 --- diff --git a/sudo.c b/sudo.c index 650a4555c..04fd3f288 100644 --- a/sudo.c +++ b/sudo.c @@ -849,10 +849,6 @@ exec_setup(rbac_enabled, ttyname, ttyfd) } #endif - /* Close the password and group files and free up memory. */ - sudo_endpwent(); - sudo_endgrent(); - /* * For sudoedit, the command runas a the user with no additional setup. */ @@ -909,6 +905,10 @@ exec_setup(rbac_enabled, ttyname, ttyfd) } #endif + /* Close the password and group files and free up memory. */ + sudo_endpwent(); + sudo_endgrent(); + rval = TRUE; done: