fixed threading issues as described in ticket [ 1971514 ]
authorbaalberith <baalberith>
Sat, 4 Oct 2008 08:51:17 +0000 (08:51 +0000)
committerbaalberith <baalberith>
Sat, 4 Oct 2008 08:51:17 +0000 (08:51 +0000)
config.h.in
configure.in
src/mod_auth_kerb.c

index fec7ca1..8f09067 100644 (file)
@@ -17,3 +17,7 @@
 
 /* Define if your GSSAPI library supports handling SPNEGO tokens */
 #undef GSSAPI_SUPPORTS_SPNEGO
+
+/* Define if your krb supports krb5_cc_new_unique function to deal with threading issues */
+#undef HAVE_KRB5_CC_NEW_UNIQUE
+
index 96f9330..95b70b1 100644 (file)
@@ -117,6 +117,9 @@ if test "x$with_krb5" != "xno" ; then
   else
      with_krb5=yes
      AC_DEFINE(KRB5)
+     AC_CHECK_LIB(krb5,
+                  krb5_cc_new_unique,
+                  [ AC_DEFINE(HAVE_KRB5_CC_NEW_UNIQUE) ])
 
      # check for Heimdal
      have_heimdal=""
index 6cf8370..1f2cbae 100644 (file)
@@ -568,7 +568,12 @@ verify_krb5_init_creds(request_rec *r, krb5_context context, krb5_creds *creds,
    } else
       keytab = ap_req_keytab;
 
+#ifdef HAVE_KRB5_CC_NEW_UNIQUE
+   ret = krb5_cc_new_unique(context, "MEMORY", NULL, &local_ccache);
+#else
    ret = krb5_cc_resolve(context, "MEMORY:", &local_ccache);
+#endif
+
    if (ret) {
       log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                 "krb5_cc_resolve() failed when verifying KDC");
@@ -715,7 +720,12 @@ verify_krb5_user(request_rec *r, krb5_context context, krb5_principal principal,
        goto end;
    }
 
+#ifdef HAVE_KRB5_CC_NEW_UNIQUE
+   ret = krb5_cc_new_unique(context, "MEMORY", NULL, &ret_ccache);
+#else
    ret = krb5_cc_resolve(context, "MEMORY:", &ret_ccache);
+#endif
+
    if (ret) {
       log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 
                 "generating new memory ccache failed: %s",