From: John Kohl Date: Tue, 5 Mar 1991 17:40:14 +0000 (+0000) Subject: condense common code into function X-Git-Tag: krb5-1.0-alpha4~111 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4e3035c6f811535a53054f6bf14c1c4e84bea2ea;p=krb5.git condense common code into function git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1861 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/rd_req_sim.c b/src/lib/krb5/krb/rd_req_sim.c index 2c964e8ba..e8a6c3500 100644 --- a/src/lib/krb5/krb/rd_req_sim.c +++ b/src/lib/krb5/krb/rd_req_sim.c @@ -60,33 +60,13 @@ krb5_tkt_authent **authdat; return(retval); } } - if (rcache = (krb5_rcache) malloc(sizeof(*rcache))) { - if (!(retval = krb5_rc_resolve_type(&rcache, "dfl"))) { - char *cachename; - extern krb5_deltat krb5_clockskew; - - if (cachename = malloc(server[1]->length+1+3)) { - strcpy(cachename, "rc_"); - strncat(cachename, server[1]->data, server[1]->length); - cachename[server[1]->length+3] = '\0'; - - if (!(retval = krb5_rc_resolve(rcache, cachename))) { - if (!((retval = krb5_rc_recover(rcache)) && - (retval = krb5_rc_initialize(rcache, - krb5_clockskew)))) { - retval = krb5_rd_req_decoded(request, server, - sender_addr, 0, - 0, 0, rcache, authdat); - krb5_rc_close(rcache); - } - } - free(cachename); - } else - retval = ENOMEM; - } + if (!(retval = krb5_get_server_rcache(server[1]->data, &rcache))) { + retval = krb5_rd_req_decoded(request, server, + sender_addr, 0, + 0, 0, rcache, authdat); + krb5_rc_close(rcache); xfree(rcache); - } else - retval = ENOMEM; + } krb5_free_ap_req(request); return retval;