From: Todd C. Miller Date: Wed, 5 Jan 2005 19:46:39 +0000 (+0000) Subject: Remove sudo_*{pw,gr}* stubs and add sudo_setspent/sudo_endspent stubs instead. X-Git-Tag: SUDO_1_7_0~749 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ab0ad2441d696c884aafbfd88caf13cb78395f1;p=sudo Remove sudo_*{pw,gr}* stubs and add sudo_setspent/sudo_endspent stubs instead. 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() --- diff --git a/visudo.c b/visudo.c index 3cd5f28bf..c7fab0212 100644 --- 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(); + */ } /*