]> granicus.if.org Git - sudo/commitdiff
Remove sudo_*{pw,gr}* stubs and add sudo_setspent/sudo_endspent stubs instead.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 5 Jan 2005 19:46:39 +0000 (19:46 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 5 Jan 2005 19:46:39 +0000 (19:46 +0000)
We can now just use the caching sudo_*{pw,gr}* functions in pwutil.c
Add comment about wanting to call sudo_endpwent/sudo_endgrent in cleanup()

visudo.c

index 3cd5f28bfde5bd01f7c12dd8cf41645aa3d20b17..c7fab021296fdb5f54033ec085d9661a5196c25f 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -555,43 +555,25 @@ user_is_exempt()
     return(FALSE);
 }
 
-char *
-sudo_getepw(pw)
-    const struct passwd *pw;
-{
-    return (pw->pw_passwd);
-}
-
-/* STUB */
-struct passwd *
-sudo_getpwuid(uid)
-    uid_t uid;
-{
-    return(getpwuid(uid));
-}
-
 /* STUB */
-struct passwd *
-sudo_getpwnam(name)
-    const char *name;
+void
+sudo_setspent()
 {
-    return(getpwnam(name));
+    return;
 }
 
 /* STUB */
-struct group *
-sudo_getgrgid(gid)
-    gid_t gid;
+void
+sudo_endspent()
 {
-    return(getgrgid(gid));
+    return;
 }
 
-/* STUB */
-struct group *
-sudo_getgrnam(name)
-    const char *name;
+char *
+sudo_getepw(pw)
+    const struct passwd *pw;
 {
-    return(getgrnam(name));
+    return (pw->pw_passwd);
 }
 
 /*
@@ -999,6 +981,12 @@ cleanup()
        if (sp->tpath != NULL)
            (void) unlink(sp->tpath);
     }
+    /*
+     * XXX - would like to call sudo_endpwent/sudo_endgrent but they
+     *       are not signal-safe.
+    sudo_endpwent();
+    sudo_endgrent();
+     */
 }
 
 /*