From: Theodore Tso Date: Thu, 2 Jun 1994 16:41:50 +0000 (+0000) Subject: rd_req_sim was using the wrong component of the server name to generate X-Git-Tag: krb5-1.0-beta4~179 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=754201bd7a7d12eb60e73a4f822595b7bc7ed8c6;p=krb5.git rd_req_sim was using the wrong component of the server name to generate the replay cache name. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3672 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 ff3c77941..0e77cdf48 100644 --- a/src/lib/krb5/krb/rd_req_sim.c +++ b/src/lib/krb5/krb/rd_req_sim.c @@ -62,7 +62,7 @@ krb5_tkt_authent **authdat; { krb5_error_code retval; krb5_ap_req *request; - krb5_rcache rcache; + krb5_rcache rcache = 0; if (!krb5_is_ap_req(inbuf)) return KRB5KRB_AP_ERR_MSG_TYPE; @@ -74,15 +74,20 @@ krb5_tkt_authent **authdat; return(retval); } } - if (!(retval = krb5_get_server_rcache(krb5_princ_component(server, 1), - &rcache))) { - retval = krb5_rd_req_decoded(request, server, - sender_addr, 0, - 0, 0, rcache, authdat); - krb5_rc_close(rcache); + + if (server) { + retval = krb5_get_server_rcache(krb5_princ_component(server, 0), + &rcache); + if (retval) + goto cleanup; } - krb5_free_ap_req(request); + retval = krb5_rd_req_decoded(request, server, sender_addr, 0, 0, 0, + rcache, authdat); +cleanup: + if (rcache) + krb5_rc_close(rcache); + krb5_free_ap_req(request); return retval; }