From 7d40eccea46260cd5de2a10ce5cc152c2e63b924 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Fri, 22 Mar 1996 04:49:59 +0000 Subject: [PATCH] use the library routines to do the v4 to v5 principal translation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7698 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 5 +++++ src/appl/bsd/krlogind.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 803e6950a..7d15aa3fa 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 20 19:36:21 1996 Richard Basch + + * 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 * kcmd.c (ruserok): declare the function as taking const char * diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index 924a1937a..da5abcf9c 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -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 -- 2.26.2