+2004-06-04 Ken Raeburn <raeburn@mit.edu>
+
+ * kuserok.c (krb5_kuserok): Handle draft POSIX versions of
+ getpwnam_r.
+
2004-06-02 Tom Yu <tlyu@mit.edu>
* an_to_ln.c (do_replacement): Patch from Bill Dodd to fix missing
int gobble;
/* no account => no access */
- if ((pwd = getpwnam(luser)) == NULL) {
+#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)
return(FALSE);
- }
(void) strncpy(pbuf, pwd->pw_dir, sizeof(pbuf) - 1);
pbuf[sizeof(pbuf) - 1] = '\0';
(void) strncat(pbuf, "/.k5login", sizeof(pbuf) - 1 - strlen(pbuf));