]> granicus.if.org Git - sudo/commitdiff
Move calls to sudo_endgrent() and sudo_endpwent() to be after
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Aug 2010 13:45:21 +0000 (09:45 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Aug 2010 13:45:21 +0000 (09:45 -0400)
set_perms(), which may do passwd or group lookups.

--HG--
branch : 1.7

sudo.c

diff --git a/sudo.c b/sudo.c
index 650a4555cdce1f2db046acc9081980d852476832..04fd3f2886b3645ecef75372569a92c398ae9e2c 100644 (file)
--- 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: