From 3993f5961e9ddab5dde5f7c9e6fd33358ab3193f Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Mon, 25 Mar 1996 16:19:38 +0000 Subject: [PATCH] krshd.c: use the library routines to do v4 to v5 principal translation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7710 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 7 ++++++- src/appl/bsd/krshd.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 4e4e7e648..c90a1c937 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -7,9 +7,14 @@ Sat Mar 23 17:20:00 1996 Sam Hartman * krshd.c (doit): Don't use non-blocking IO; it is unnecessary and may cause problems. +Fri Mar 22 13:27:40 1996 Richard Basch + + * krshd.c: use the library routines to do v4 to v5 + principal translation, for a more accurate representation. + Wed Mar 20 19:36:21 1996 Richard Basch - * krlogind.c (recvauth): use the library routines to do v4 to v5 + * krlogind.c: 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 diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index a7ba147fd..eae3ab584 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -1728,15 +1728,15 @@ krb5_authenticator *authenticator; * principal's name. */ strcpy(remuser, v4_kdata->pname); - kremuser = (char *) malloc(strlen(v4_kdata->pname) + 1 + - strlen(v4_kdata->pinst) + 1 + - strlen(v4_kdata->prealm) + 1); - sprintf(kremuser, "%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, &kremuser); - if (status = krb5_parse_name(bsd_context, kremuser, &client)) - return(status); - return 0; + return status; } /* Must be V5 */ -- 2.26.2