use getpwnamn_r if it exists

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14842 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-04-19 05:23:42 +00:00
parent c6fcedc6e0
commit 796e0562a0

View File

@@ -145,7 +145,15 @@ krb5_kuserok (krb5_context context,
krb5_error_code ret;
krb5_boolean result = FALSE;
pwd = getpwnam (luser); /* XXX - Should use k_getpwnam? */
#ifdef HAVE_GETPWNAM_R
char pwbuf[2048];
struct passwd pw;
if(getpwnam_r(luser, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0)
return FALSE;
#else
pwd = getpwnam (luser);
#endif
if (pwd == NULL)
return FALSE;