From 8afd18519f744a236cca8cf98852bd47b304f068 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 9 Nov 1995 14:39:34 +0000 Subject: [PATCH] sim_client.c (main): Use krb5_get_server_rcache instead of duplicating code. Remove use of krb5_clockskew variable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7074 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/simple/client/ChangeLog | 5 +++++ src/appl/simple/client/sim_client.c | 28 +++++++--------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/appl/simple/client/ChangeLog b/src/appl/simple/client/ChangeLog index 8f24529c2..b8bfe7cc0 100644 --- a/src/appl/simple/client/ChangeLog +++ b/src/appl/simple/client/ChangeLog @@ -1,3 +1,8 @@ +Thu Nov 9 09:33:38 1995 Ezra Peisach (epeisach@kangaroo.mit.edu) + + * sim_client.c (main): Use krb5_get_server_rcache instead of + duplicating code. Remove use of krb5_clockskew variable. + Sun Oct 15 10:49:35 1995 * sim_client.c (main): Fixed location where usage() wasn't being diff --git a/src/appl/simple/client/sim_client.c b/src/appl/simple/client/sim_client.c index b0df5ca32..ca966c1fa 100644 --- a/src/appl/simple/client/sim_client.c +++ b/src/appl/simple/client/sim_client.c @@ -89,7 +89,7 @@ main(argc, argv) krb5_ccache ccdef; krb5_address addr, *portlocal_addr; krb5_rcache rcache; - extern krb5_deltat krb5_clockskew; + krb5_data rcache_name; krb5_context context; krb5_auth_context auth_context = NULL; @@ -277,26 +277,12 @@ main(argc, argv) com_err(progname, retval, "while generating replay cache name"); exit(1); } - if (!(rcache = (krb5_rcache)malloc(sizeof(*rcache)))) { - com_err(progname, ENOMEM, "while allocating replay cache"); - exit(1); - } - if ((retval = krb5_rc_resolve_type(context, &rcache, - krb5_rc_default_type(context)))) { - krb5_xfree(rcache); - com_err(progname, retval, "while resolving replay cache type"); - exit(1); - } - if ((retval = krb5_rc_resolve(context, rcache, cp))) { - krb5_xfree(rcache); - com_err(progname, retval, "while resolving replay cache type"); - exit(1); - } - if ((retval = krb5_rc_recover(context, rcache)) && - (retval = krb5_rc_initialize(context, rcache, krb5_clockskew))) { - com_err(progname, retval, "while initializing replay cache '%s:%s'", - rcache->ops->type, - krb5_rc_get_name(context, rcache)); + + rcache_name.length = strlen(cp); + rcache_name.data = cp; + + if ((retval = krb5_get_server_rcache(context, &rcache_name, &rcache))) { + com_err(progname, retval, "while getting server rcache"); exit(1); } -- 2.26.2