From: Tom Yu Date: Mon, 27 Mar 2006 16:04:16 +0000 (+0000) Subject: * g_initialize.c (init_hardcoded): Re-order to put SPNEGO first X-Git-Tag: ms-bug-test-20060525~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6c00666233a4e8fc90beb1bdf7da311f0c4c6d2b;p=krb5.git * 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. git-svn-id: svn://anonsvn.mit.edu/krb5/users/tlyu/branches/mechglue@17779 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/mechglue/ChangeLog b/src/lib/gssapi/mechglue/ChangeLog index a8960fc0f..c2d28d3e4 100644 --- a/src/lib/gssapi/mechglue/ChangeLog +++ b/src/lib/gssapi/mechglue/ChangeLog @@ -1,3 +1,10 @@ +2006-03-27 Tom Yu + + * 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 * g_userok.c: Don't include synch.h or gssapi_ext.h. diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c index c8040cd92..cb12d2e17 100644 --- a/src/lib/gssapi/mechglue/g_initialize.c +++ b/src/lib/gssapi/mechglue/g_initialize.c @@ -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(""); - 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(""); - 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(""); - 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; }