use the library routines to do the v4 to v5 principal translation
authorRichard Basch <probe@mit.edu>
Fri, 22 Mar 1996 04:49:59 +0000 (04:49 +0000)
committerRichard Basch <probe@mit.edu>
Fri, 22 Mar 1996 04:49:59 +0000 (04:49 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7698 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/krlogind.c

index 803e6950af88984689c3a9ee09f8195715661e92..7d15aa3fa8d3298fe9e125c2e83c3e03f139c545 100644 (file)
@@ -1,3 +1,8 @@
+Wed Mar 20 19:36:21 1996  Richard Basch  <basch@lehman.com>
+
+       * krlogind.c (recvauth): use the library routines to do v4 to v5
+       principal translation, for a more accurate representation.
+
 Tue Mar 19 20:11:28 1996  Richard Basch  <basch@lehman.com>
 
        * kcmd.c (ruserok): declare the function as taking const char *
index 924a1937a29f5017a53cb45b3a6d4242e165d0d7..da5abcf9c5371907a1e36f7622153025641739ea 100644 (file)
@@ -1585,15 +1585,15 @@ recvauth(valid_checksum)
         * principal's name. 
          */
        strcpy(rusername, v4_kdata->pname);
-       krusername = (char *) malloc(strlen(v4_kdata->pname) + 1 +
-                                    strlen(v4_kdata->pinst) + 1 +
-                                    strlen(v4_kdata->prealm) + 1);
-       sprintf(krusername, "%s/%s@%s", v4_kdata->pname,
-               v4_kdata->pinst, v4_kdata->prealm);
+
+       status = krb5_425_conv_principal(bsd_context, v4_kdata->pname,
+                                        v4_kdata->pinst, v4_kdata->prealm,
+                                        &client);
+       if (status) return status;
+
+       status = krb5_unparse_name(bsd_context, client, &krusername);
        
-       if (status = krb5_parse_name(bsd_context, krusername, &client))
-         return(status);
-       return 0;
+       return status;
     }
 #endif