+2004-07-29 Ken Raeburn <raeburn@mit.edu>
+
+ * gssapi_krb5.c (kg_ccache_name): Variable deleted.
+ (kg_sync_ccache_name, kg_get_ccache_name, kg_set_ccache_name): Get
+ and set thread-specific values instead.
+
2004-07-28 Ken Raeburn <raeburn@mit.edu>
* gssapiP_krb5.h (struct _krb5_gss_cred_id_rec): Add a mutex.
const gss_OID_set_desc * const gss_mech_set_krb5_both = oidsets+2;
g_set kg_vdb = G_SET_INIT;
-static char *kg_ccache_name = NULL;
/** default credential support */
*/
if (!err) {
- /* kg_ccache_name == NULL resets the context default ccache */
- err = krb5_cc_set_default_name(context, kg_ccache_name);
+ /* if NULL, resets the context default ccache */
+ err = krb5_cc_set_default_name(context,
+ (char *) k5_getspecific(K5_KEY_GSS_KRB5_CCACHE_NAME));
}
*minor_status = err;
{
const char *name = NULL;
OM_uint32 err = 0;
+ char *kg_ccache_name;
+
+ kg_ccache_name = k5_getspecific(K5_KEY_GSS_KRB5_CCACHE_NAME);
if (kg_ccache_name != NULL) {
name = strdup(kg_ccache_name);
{
char *new_name = NULL;
char *swap = NULL;
+ char *kg_ccache_name;
+ krb5_error_code kerr;
if (name) {
new_name = malloc(strlen(name) + 1);
strcpy(new_name, name);
}
+ kg_ccache_name = k5_getspecific(K5_KEY_GSS_KRB5_CCACHE_NAME);
swap = kg_ccache_name;
kg_ccache_name = new_name;
new_name = swap;
+ kerr = k5_setspecific(K5_KEY_GSS_KRB5_CCACHE_NAME, kg_ccache_name);
+ if (kerr != 0) {
+ /* Can't store, so free up the storage. */
+ free(kg_ccache_name);
+ /* ??? free(new_name); */
+ *minor_status = kerr;
+ return GSS_S_FAILURE;
+ }
free (new_name);
*minor_status = 0;