From: Ken Raeburn Date: Sat, 26 Mar 2005 02:05:06 +0000 (+0000) Subject: * kuserok.c (krb5_kuserok): Use k5_getpwnam_r X-Git-Tag: ms-bug-test-20060525~301 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=74cc2af420298ff9cf4e494d89b0c5219ea26d0b;p=krb5.git * kuserok.c (krb5_kuserok): Use k5_getpwnam_r ticket: 2982 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17157 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 1823a2fcb..6a60ce460 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,7 @@ +2005-03-25 Ken Raeburn + + * kuserok.c (krb5_kuserok): Use k5_getpwnam_r. + 2005-03-22 Tom Yu * dnsglue.h: Define ns_rr_class to ns_rr_cl if ns_rr_class doesn't diff --git a/src/lib/krb5/os/kuserok.c b/src/lib/krb5/os/kuserok.c index c0111b995..356b98706 100644 --- a/src/lib/krb5/os/kuserok.c +++ b/src/lib/krb5/os/kuserok.c @@ -74,21 +74,9 @@ krb5_kuserok(krb5_context context, krb5_principal principal, const char *luser) int gobble; /* no account => no access */ -#ifdef HAVE_GETPWNAM_R char pwbuf[BUFSIZ]; struct passwd pwx; -#if !defined(GETPWNAM_R_4_ARGS) - /* POSIX */ - if (getpwnam_r(luser, &pwx, pwbuf, sizeof(pwbuf), &pwd) != 0) - pwd = NULL; -#else - /* draft POSIX */ - pwd = getpwnam_r(luser, &pwx, pwbuf, sizeof(pwbuf)); -#endif -#else - pwd = getpwnam(luser); -#endif - if (pwd == NULL) + if (k5_getpwnam_r(luser, &pwx, pwbuf, sizeof(pwbuf), &pwd) != 0) return(FALSE); (void) strncpy(pbuf, pwd->pw_dir, sizeof(pbuf) - 1); pbuf[sizeof(pbuf) - 1] = '\0';