* g_initialize.c (init_hardcoded): Re-order to put SPNEGO first
authorTom Yu <tlyu@mit.edu>
Mon, 27 Mar 2006 16:04:16 +0000 (16:04 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 27 Mar 2006 16:04:16 +0000 (16:04 +0000)
for testing purposes.
(gssint_mechglue_init, gssint_mechglue_fini): Initialize and
destroy g_mechSetLock.

git-svn-id: svn://anonsvn.mit.edu/krb5/users/tlyu/branches/mechglue@17779 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/ChangeLog
src/lib/gssapi/mechglue/g_initialize.c

index a8960fc0f33a8dcee0124d5d00f3f5df8f40f82e..c2d28d3e4ffe2d1a2012886c4b3e822a551f4c0a 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-27  Tom Yu  <tlyu@mit.edu>
+
+       * g_initialize.c (init_hardcoded): Re-order to put SPNEGO first
+       for testing purposes.
+       (gssint_mechglue_init, gssint_mechglue_fini): Initialize and
+       destroy g_mechSetLock.
+
 2006-03-26  Tom Yu  <tlyu@mit.edu>
 
        * g_userok.c: Don't include synch.h or gssapi_ext.h.
index c8040cd92e6b9cadddb925fc61a1b2ceb5cf60d6..cb12d2e17a1b216f7e9f834d8bcb0eb5ecd1f828 100644 (file)
@@ -73,15 +73,23 @@ static gss_mech_info g_mechListTail = NULL;
 static k5_mutex_t g_mechListLock = K5_MUTEX_PARTIAL_INITIALIZER;
 static time_t g_confFileModTime = (time_t)0;
 
+static time_t g_mechSetTime = (time_t)0;
+static gss_OID_set_desc g_mechSet = { 0, NULL };
+static k5_mutex_t g_mechSetLock = K5_MUTEX_PARTIAL_INITIALIZER;
+
 int
 gssint_mechglue_init(void)
 {
+       int err;
+
+       err = k5_mutex_finish_init(&g_mechSetLock);
        return k5_mutex_finish_init(&g_mechListLock);
 }
 
 void
 gssint_mechglue_fini(void)
 {
+       k5_mutex_destroy(&g_mechSetLock);
        k5_mutex_destroy(&g_mechListLock);
 }
 
@@ -140,11 +148,6 @@ gss_OID *oid;
  * To avoid reading the configuration file each call, we will save a
  * a mech oid set, and only update it once the file has changed.
  */
-static time_t g_mechSetTime = (time_t)0;
-static gss_OID_set_desc g_mechSet = { 0, NULL };
-static k5_mutex_t g_mechSetLock;
-
-
 OM_uint32
 gss_indicate_mechs(minorStatus, mechSet)
 OM_uint32 *minorStatus;
@@ -522,33 +525,36 @@ init_hardcoded(void)
                return;
        memset(cf, 0, sizeof(*cf));
        cf->uLibName = strdup("<hardcoded internal>");
-       cf->mechNameStr = "kerberos_v5";
-       cf->mech_type = &krb5_mechanism.mech_type;
-       cf->mech = &krb5_mechanism;
+       cf->mechNameStr = "spnego";
+       cf->mech_type = &spnego_mechanism.mech_type;
+       cf->mech = &spnego_mechanism;
        cf->next = NULL;
        g_mechList = cf;
+       g_mechListTail = cf;
 
        cf = malloc(sizeof(*cf));
        if (cf == NULL)
                return;
        memset(cf, 0, sizeof(*cf));
        cf->uLibName = strdup("<hardcoded internal>");
-       cf->mechNameStr = "kerberos_v5 (old)";
-       cf->mech_type = &krb5_mechanism_old.mech_type;
-       cf->mech = &krb5_mechanism_old;
+       cf->mechNameStr = "kerberos_v5";
+       cf->mech_type = &krb5_mechanism.mech_type;
+       cf->mech = &krb5_mechanism;
        cf->next = NULL;
-       g_mechList->next = cf;
+       g_mechListTail->next = cf;
+       g_mechListTail = cf;
 
        cf = malloc(sizeof(*cf));
        if (cf == NULL)
                return;
        memset(cf, 0, sizeof(*cf));
        cf->uLibName = strdup("<hardcoded internal>");
-       cf->mechNameStr = "spnego";
-       cf->mech_type = &spnego_mechanism.mech_type;
-       cf->mech = &spnego_mechanism;
+       cf->mechNameStr = "kerberos_v5 (old)";
+       cf->mech_type = &krb5_mechanism_old.mech_type;
+       cf->mech = &krb5_mechanism_old;
        cf->next = NULL;
-       g_mechList->next->next = cf;
+       g_mechListTail->next = cf;
+       g_mechListTail = cf;
 
        inited = 1;
 }