"old" name to free. Save the new old name in thread-specific data.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16594
dc483132-0cff-0310-8789-
dd5450dbe970
the mutex while manipulating krb5_gss_keytab.
* gssapiP_krb5.h (gssint_krb5_keytab_lock): Declare.
+ * set_ccache.c (gss_krb5_ccache_name): Check thread-specific data
+ for the saved "old" name to free. Save the new old name in
+ thread-specific data.
+
2004-07-08 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (LOCALINCLUDES): Add $(srcdir)/.. to the list.
const char *name;
const char **out_name;
{
- static char *gss_out_name = NULL;
-
char *old_name = NULL;
OM_uint32 err = 0;
OM_uint32 minor = 0;
+ char *gss_out_name;
+
+ err = gssint_initialize_library();
+ if (err) {
+ *minor_status = err;
+ return GSS_S_FAILURE;
+ }
+
+ gss_out_name = k5_getspecific(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME);
+
if (out_name) {
const char *tmp_name = NULL;
}
if (!err) {
- char *swap = NULL;
-
+ char *swap = NULL;
+
swap = gss_out_name;
gss_out_name = old_name;
old_name = swap;
err = minor;
}
}
-
+
+ minor = k5_setspecific(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME, gss_out_name);
+ if (minor) {
+ /* Um. Now what? */
+ if (err == 0) {
+ err = minor;
+ if (out_name != NULL) {
+ *out_name = NULL;
+ out_name = NULL;
+ }
+ }
+ free(gss_out_name);
+ }
+
if (!err) {
if (out_name) {
*out_name = gss_out_name;