From c7b0d01002cf973d8ea64d181930087844921e1f Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Fri, 5 May 1995 03:54:58 +0000 Subject: [PATCH] * krcp.c (answer_auth()): Don't destroy the credential cache git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5724 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 4 ++++ src/appl/bsd/krcp.c | 27 ++++++++++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 56ab441ad..28736c8f1 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,4 +1,8 @@ +Thu May 04 23:53:23 1995 Chris Provenzano (proven@mit.edu) + + * krcp.c (answer_auth()): Don't destroy the credential cache. + Wed May 03 20:10:39 1995 Chris Provenzano (proven@mit.edu) * krcp.c (answer_auth()): Set auth_context = NULL before using it. diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c index 8a72a3d4e..32fa2bfec 100644 --- a/src/appl/bsd/krcp.c +++ b/src/appl/bsd/krcp.c @@ -1330,36 +1330,29 @@ void exit(1); } - if (status = krb5_cc_get_principal(bsd_context, cc, &creds.client)){ - krb5_cc_destroy(bsd_context, cc); + if (status = krb5_cc_get_principal(bsd_context, cc, &creds.client)) exit(1); - } - if (status = krb5_parse_name(bsd_context, pname_data.data, &creds.server)){ - krb5_cc_destroy(bsd_context, cc); + if (status = krb5_parse_name(bsd_context, pname_data.data, &creds.server)) exit(1); - } + krb5_xfree(pname_data.data); - if (status = krb5_get_credentials(bsd_context, KRB5_GC_USER_USER, cc, - &creds, &new_creds)){ - krb5_cc_destroy(bsd_context, cc); + &creds, &new_creds)) exit(1); - } if (status = krb5_mk_req_extended(bsd_context, &auth_context, AP_OPTS_USE_SESSION_KEY, - NULL, new_creds, &msg)) { - krb5_cc_destroy(bsd_context, cc); + NULL, new_creds, &msg)) exit(1); - } - status = krb5_write_message(bsd_context, (krb5_pointer) &rem, &msg); - krb5_cc_destroy(bsd_context, cc); - krb5_xfree(msg.data); - if (status){ + + if (status = krb5_write_message(bsd_context, (krb5_pointer) &rem, &msg)) { + krb5_xfree(msg.data); exit(1); } + krb5_xfree(msg.data); + /* setup eblock for des_read and write */ krb5_copy_keyblock(bsd_context, &new_creds->keyblock,&session_key); -- 2.26.2