* kuserok.c (krb5_kuserok): Use k5_getpwnam_r
authorKen Raeburn <raeburn@mit.edu>
Sat, 26 Mar 2005 02:05:06 +0000 (02:05 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 26 Mar 2005 02:05:06 +0000 (02:05 +0000)
ticket: 2982
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17157 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/kuserok.c

index 1823a2fcb3383cb0c743e3dd0b2d18874065c3ab..6a60ce46082adad813922458e7d69d842e8c3e38 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-25  Ken Raeburn  <raeburn@mit.edu>
+
+       * kuserok.c (krb5_kuserok): Use k5_getpwnam_r.
+
 2005-03-22  Tom Yu  <tlyu@mit.edu>
 
        * dnsglue.h: Define ns_rr_class to ns_rr_cl if ns_rr_class doesn't
index c0111b995e2343280cb6bd49332c8e866c5dc0d1..356b98706f22c02f9c294da57e9e8463f0e7ab0c 100644 (file)
@@ -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';