From 7cdc89edca112870f5e9dcb27cbb4cd5551ae7a4 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 17 Feb 2010 14:01:14 +0000 Subject: [PATCH] aklog: Actually use new get_realm_from_cred fn An earlier patch added the new get_realm_from_cred function, but failed to update the callsite to use it. Fix that. Change-Id: I9e9d7545b20df041400d140e80c7f018b033043e Reviewed-on: http://gerrit.openafs.org/1334 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/aklog/aklog.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index f7e57abaa4..ecb1cb77fa 100644 --- a/src/aklog/aklog.c +++ b/src/aklog/aklog.c @@ -663,26 +663,18 @@ auth_to_cell(krb5_context context, char *cell, char *realm, char **linkedcell) /* If we've got a valid ticket, and we still don't know the realm name * try to figure it out from the contents of the ticket */ -#if !defined(USING_HEIMDAL) && defined(HAVE_KRB5_DECODE_TICKET) if (strcmp(realm_of_cell, "") == 0) { - krb5_error_code code; - krb5_ticket *ticket; - - code = krb5_decode_ticket(&v5cred->ticket, &ticket); - - if (code != 0) { + status = get_realm_from_cred(context, v5cred, &realm_from_princ); + if (status) { fprintf(stderr, "%s: Couldn't decode ticket to determine realm for " "cell %s.\n", progname, cellconf.name); } else { - realm_from_princ = extract_realm(context, ticket->server); - realm_of_cell = realm_from_princ; - - krb5_free_ticket(context, ticket); + if (realm_from_princ) + realm_of_cell = realm_from_princ; } } -#endif strncpy(aserver.name, AFSKEY, MAXKTCNAMELEN - 1); strncpy(aserver.instance, AFSINST, MAXKTCNAMELEN - 1);