* import_name.c (krb5_gss_import_name): Use k5_getpwuid_r
authorKen Raeburn <raeburn@mit.edu>
Sat, 26 Mar 2005 02:15:55 +0000 (02:15 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 26 Mar 2005 02:15:55 +0000 (02:15 +0000)
ticket: 2982
status: open

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

src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/import_name.c

index e49be6ba37b802d8ca7e47fc42ac9c9e89f087d8..aa492e4016d2dd5eaed3e9ed190c3fb301ba643c 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-25  Ken Raeburn  <raeburn@mit.edu>
+
+       * import_name.c (krb5_gss_import_name): Use k5_getpwuid_r.
+
 2005-01-13 Jeffrey Altman <jaltman@mit.edu>
 
         * init_sec_context.c, acquire_cred.c: fix calls to 
index ed78b1e258f42a4824b200123acd4e43c0839a72..7969cca3aa88f89d72fbe662f3b82972d1c21981 100644 (file)
@@ -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)) {