From: Ken Raeburn Date: Sat, 26 Mar 2005 02:15:55 +0000 (+0000) Subject: * import_name.c (krb5_gss_import_name): Use k5_getpwuid_r X-Git-Tag: ms-bug-test-20060525~299 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=016b2466c33858d2ff89847e3633081be01198a5;p=krb5.git * import_name.c (krb5_gss_import_name): Use k5_getpwuid_r ticket: 2982 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17159 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index e49be6ba3..aa492e401 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,7 @@ +2005-03-25 Ken Raeburn + + * import_name.c (krb5_gss_import_name): Use k5_getpwuid_r. + 2005-01-13 Jeffrey Altman * init_sec_context.c, acquire_cred.c: fix calls to diff --git a/src/lib/gssapi/krb5/import_name.c b/src/lib/gssapi/krb5/import_name.c index ed78b1e25..7969cca3a 100644 --- a/src/lib/gssapi/krb5/import_name.c +++ b/src/lib/gssapi/krb5/import_name.c @@ -121,10 +121,8 @@ krb5_gss_import_name(minor_status, input_name_buffer, } else { #ifndef NO_PASSWORD uid_t uid; -#ifdef HAVE_GETPWUID_R struct passwd pwx; char pwbuf[BUFSIZ]; -#endif #endif stringrep = NULL; @@ -148,18 +146,8 @@ krb5_gss_import_name(minor_status, input_name_buffer, } else if (g_OID_equal(input_name_type, gss_nt_machine_uid_name)) { uid = *(uid_t *) input_name_buffer->value; do_getpwuid: -#ifndef HAVE_GETPWUID_R - pw = getpwuid(uid); -#elif defined(GETPWUID_R_4_ARGS) - /* old POSIX drafts */ - pw = getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf)); -#else - /* POSIX */ - if (getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw) != 0) - pw = NULL; -#endif - if (pw) - stringrep = pw->pw_name; + if (k5_getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw) == 0) + stringrep = pw->pw_name; else *minor_status = (OM_uint32) G_NOUSER; } else if (g_OID_equal(input_name_type, gss_nt_string_uid_name)) {