(proto): start to use gss_krb5_copy_ccache

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12324 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-05-21 15:16:14 +00:00
parent 74ede60132
commit d2db6a97db

View File

@@ -156,8 +156,7 @@ proto (int sock, const char *service)
input_chan_bindings.application_data.value = NULL; input_chan_bindings.application_data.value = NULL;
#endif #endif
delegated_cred_handle = emalloc(sizeof(*delegated_cred_handle)); delegated_cred_handle = GSS_C_NO_CREDENTIAL;
memset((char*)delegated_cred_handle, 0, sizeof(*delegated_cred_handle));
do { do {
read_token (sock, input_token); read_token (sock, input_token);
@@ -186,15 +185,16 @@ proto (int sock, const char *service)
} }
} while(maj_stat & GSS_S_CONTINUE_NEEDED); } while(maj_stat & GSS_S_CONTINUE_NEEDED);
if (delegated_cred_handle->ccache) { if (delegated_cred_handle != GSS_C_NO_CREDENTIAL) {
krb5_context context; krb5_context context;
maj_stat = krb5_init_context(&context); maj_stat = krb5_init_context(&context);
maj_stat = krb5_cc_resolve(context, "FILE:/tmp/krb5cc_test", &ccache); maj_stat = krb5_cc_resolve(context, "FILE:/tmp/krb5cc_test", &ccache);
maj_stat = krb5_cc_copy_cache(context, maj_stat = gss_krb5_copy_ccache(&min_stat,
delegated_cred_handle->ccache, ccache); delegated_cred_handle,
ccache);
krb5_cc_close(context, ccache); krb5_cc_close(context, ccache);
krb5_cc_destroy(context, delegated_cred_handle->ccache); gss_release_cred(&min_stat, &delegated_cred_handle);
} }
if (fork_flag) { if (fork_flag) {