prefix SLIST with HEIM
This commit is contained in:
@@ -28,12 +28,12 @@
|
||||
*/
|
||||
|
||||
struct _gss_mechanism_cred {
|
||||
SLIST_ENTRY(_gss_mechanism_cred) gmc_link;
|
||||
HEIM_SLIST_ENTRY(_gss_mechanism_cred) gmc_link;
|
||||
gssapi_mech_interface gmc_mech; /* mechanism ops for MC */
|
||||
gss_OID gmc_mech_oid; /* mechanism oid for MC */
|
||||
gss_cred_id_t gmc_cred; /* underlying MC */
|
||||
};
|
||||
SLIST_HEAD(_gss_mechanism_cred_list, _gss_mechanism_cred);
|
||||
HEIM_SLIST_HEAD(_gss_mechanism_cred_list, _gss_mechanism_cred);
|
||||
|
||||
struct _gss_cred {
|
||||
struct _gss_mechanism_cred_list gc_mc;
|
||||
|
@@ -209,7 +209,7 @@ gss_accept_sec_context(OM_uint32 *minor_status,
|
||||
}
|
||||
|
||||
if (cred) {
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link)
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link)
|
||||
if (mc->gmc_mech == m)
|
||||
break;
|
||||
if (!mc) {
|
||||
@@ -285,7 +285,7 @@ gss_accept_sec_context(OM_uint32 *minor_status,
|
||||
gss_delete_sec_context(&junk, context_handle, NULL);
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
SLIST_INIT(&dcred->gc_mc);
|
||||
HEIM_SLIST_INIT(&dcred->gc_mc);
|
||||
dmc = malloc(sizeof(struct _gss_mechanism_cred));
|
||||
if (!dmc) {
|
||||
free(dcred);
|
||||
@@ -296,7 +296,7 @@ gss_accept_sec_context(OM_uint32 *minor_status,
|
||||
dmc->gmc_mech = m;
|
||||
dmc->gmc_mech_oid = &m->gm_mech_oid;
|
||||
dmc->gmc_cred = delegated_mc;
|
||||
SLIST_INSERT_HEAD(&dcred->gc_mc, dmc, gmc_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&dcred->gc_mc, dmc, gmc_link);
|
||||
|
||||
*delegated_cred_handle = (gss_cred_id_t) dcred;
|
||||
}
|
||||
|
@@ -90,7 +90,7 @@ gss_acquire_cred(OM_uint32 *minor_status,
|
||||
*minor_status = ENOMEM;
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
SLIST_INIT(&cred->gc_mc);
|
||||
HEIM_SLIST_INIT(&cred->gc_mc);
|
||||
|
||||
if (mechs == GSS_C_NO_OID_SET)
|
||||
mechs = _gss_mech_oids;
|
||||
@@ -145,14 +145,14 @@ gss_acquire_cred(OM_uint32 *minor_status,
|
||||
}
|
||||
}
|
||||
|
||||
SLIST_INSERT_HEAD(&cred->gc_mc, mc, gmc_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&cred->gc_mc, mc, gmc_link);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we didn't manage to create a single credential, return
|
||||
* an error.
|
||||
*/
|
||||
if (!SLIST_FIRST(&cred->gc_mc)) {
|
||||
if (!HEIM_SLIST_FIRST(&cred->gc_mc)) {
|
||||
free(cred);
|
||||
if (actual_mechs)
|
||||
gss_release_oid_set(minor_status, actual_mechs);
|
||||
|
@@ -106,7 +106,7 @@ gss_add_cred(OM_uint32 *minor_status,
|
||||
*minor_status = ENOMEM;
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
SLIST_INIT(&new_cred->gc_mc);
|
||||
HEIM_SLIST_INIT(&new_cred->gc_mc);
|
||||
|
||||
/*
|
||||
* We go through all the mc attached to the input_cred_handle
|
||||
@@ -116,7 +116,7 @@ gss_add_cred(OM_uint32 *minor_status,
|
||||
*/
|
||||
target_mc = 0;
|
||||
if (cred) {
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
if (gss_oid_equal(mc->gmc_mech_oid, desired_mech)) {
|
||||
target_mc = mc;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ gss_add_cred(OM_uint32 *minor_status,
|
||||
*minor_status = ENOMEM;
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
SLIST_INSERT_HEAD(&new_cred->gc_mc, copy_mc, gmc_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&new_cred->gc_mc, copy_mc, gmc_link);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ gss_add_cred(OM_uint32 *minor_status,
|
||||
free(mc);
|
||||
return (major_status);
|
||||
}
|
||||
SLIST_INSERT_HEAD(&new_cred->gc_mc, mc, gmc_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&new_cred->gc_mc, mc, gmc_link);
|
||||
*output_cred_handle = (gss_cred_id_t) new_cred;
|
||||
|
||||
return (GSS_S_COMPLETE);
|
||||
|
@@ -99,11 +99,11 @@ gss_canonicalize_name(OM_uint32 *minor_status,
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
|
||||
SLIST_INIT(&name->gn_mn);
|
||||
HEIM_SLIST_INIT(&name->gn_mn);
|
||||
mn->gmn_mech = m;
|
||||
mn->gmn_mech_oid = &m->gm_mech_oid;
|
||||
mn->gmn_name = new_canonical_name;
|
||||
SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
|
||||
*output_name = (gss_name_t) name;
|
||||
|
||||
|
@@ -55,7 +55,7 @@ gss_compare_name(OM_uint32 *minor_status,
|
||||
struct _gss_mechanism_name *mn1;
|
||||
struct _gss_mechanism_name *mn2;
|
||||
|
||||
SLIST_FOREACH(mn1, &name1->gn_mn, gmn_link) {
|
||||
HEIM_SLIST_FOREACH(mn1, &name1->gn_mn, gmn_link) {
|
||||
OM_uint32 major_status;
|
||||
|
||||
major_status = _gss_find_mn(minor_status, name2,
|
||||
|
@@ -62,7 +62,7 @@ gss_export_cred(OM_uint32 * minor_status,
|
||||
return GSS_S_NO_CRED;
|
||||
}
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
if (mc->gmc_mech->gm_export_cred == NULL) {
|
||||
*minor_status = 0;
|
||||
return GSS_S_NO_CRED;
|
||||
@@ -75,7 +75,7 @@ gss_export_cred(OM_uint32 * minor_status,
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
|
||||
major = mc->gmc_mech->gm_export_cred(minor_status,
|
||||
mc->gmc_cred, &buffer);
|
||||
@@ -138,7 +138,7 @@ gss_import_cred(OM_uint32 * minor_status,
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
SLIST_INIT(&cred->gc_mc);
|
||||
HEIM_SLIST_INIT(&cred->gc_mc);
|
||||
|
||||
*cred_handle = (gss_cred_id_t)cred;
|
||||
|
||||
@@ -201,12 +201,12 @@ gss_import_cred(OM_uint32 * minor_status,
|
||||
mc->gmc_mech_oid = &m->gm_mech_oid;
|
||||
mc->gmc_cred = mcred;
|
||||
|
||||
SLIST_INSERT_HEAD(&cred->gc_mc, mc, gmc_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&cred->gc_mc, mc, gmc_link);
|
||||
}
|
||||
krb5_storage_free(sp);
|
||||
sp = NULL;
|
||||
|
||||
if (SLIST_EMPTY(&cred->gc_mc)) {
|
||||
if (HEIM_SLIST_EMPTY(&cred->gc_mc)) {
|
||||
major = GSS_S_NO_CRED;
|
||||
goto out;
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ gss_display_name(OM_uint32 *minor_status,
|
||||
*minor_status = 0;
|
||||
return (GSS_S_COMPLETE);
|
||||
} else {
|
||||
SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
major_status = mn->gmn_mech->gm_display_name(
|
||||
minor_status, mn->gmn_name,
|
||||
output_name_buffer,
|
||||
|
@@ -53,7 +53,7 @@ gss_duplicate_name(OM_uint32 *minor_status,
|
||||
return (major_status);
|
||||
new_name = (struct _gss_name *) *dest_name;
|
||||
|
||||
SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
struct _gss_mechanism_name *mn2;
|
||||
_gss_find_mn(minor_status, new_name,
|
||||
mn->gmn_mech_oid, &mn2);
|
||||
@@ -65,10 +65,10 @@ gss_duplicate_name(OM_uint32 *minor_status,
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
memset(new_name, 0, sizeof(struct _gss_name));
|
||||
SLIST_INIT(&new_name->gn_mn);
|
||||
HEIM_SLIST_INIT(&new_name->gn_mn);
|
||||
*dest_name = (gss_name_t) new_name;
|
||||
|
||||
SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
struct _gss_mechanism_name *new_mn;
|
||||
|
||||
new_mn = malloc(sizeof(*new_mn));
|
||||
@@ -86,7 +86,7 @@ gss_duplicate_name(OM_uint32 *minor_status,
|
||||
free(new_mn);
|
||||
continue;
|
||||
}
|
||||
SLIST_INSERT_HEAD(&new_name->gn_mn, new_mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&new_name->gn_mn, new_mn, gmn_link);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ gss_export_name(OM_uint32 *minor_status,
|
||||
* one, otherwise export based on the first mechanism in our
|
||||
* list.
|
||||
*/
|
||||
mn = SLIST_FIRST(&name->gn_mn);
|
||||
mn = HEIM_SLIST_FIRST(&name->gn_mn);
|
||||
if (!mn) {
|
||||
*minor_status = 0;
|
||||
return (GSS_S_NAME_NOT_MN);
|
||||
|
@@ -209,7 +209,7 @@ gss_import_name(OM_uint32 *minor_status,
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
|
||||
SLIST_INIT(&name->gn_mn);
|
||||
HEIM_SLIST_INIT(&name->gn_mn);
|
||||
|
||||
major_status = _gss_copy_oid(minor_status,
|
||||
name_type, &name->gn_type);
|
||||
@@ -228,7 +228,7 @@ gss_import_name(OM_uint32 *minor_status,
|
||||
* for those supported this nametype.
|
||||
*/
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
int present = 0;
|
||||
|
||||
major_status = gss_test_oid_set_member(minor_status,
|
||||
@@ -257,14 +257,14 @@ gss_import_name(OM_uint32 *minor_status,
|
||||
|
||||
mn->gmn_mech = &m->gm_mech;
|
||||
mn->gmn_mech_oid = &m->gm_mech_oid;
|
||||
SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we can't find a mn for the name, bail out already here.
|
||||
*/
|
||||
|
||||
mn = SLIST_FIRST(&name->gn_mn);
|
||||
mn = HEIM_SLIST_FIRST(&name->gn_mn);
|
||||
if (!mn) {
|
||||
*minor_status = 0;
|
||||
major_status = GSS_S_NAME_NOT_MN;
|
||||
|
@@ -43,7 +43,7 @@ gss_indicate_mechs(OM_uint32 *minor_status,
|
||||
if (major_status)
|
||||
return (major_status);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_indicate_mechs) {
|
||||
major_status = m->gm_mech.gm_indicate_mechs(
|
||||
minor_status, &set);
|
||||
|
@@ -37,7 +37,7 @@ _gss_mech_cred_find(gss_cred_id_t cred_handle, gss_OID mech_type)
|
||||
if (cred == NULL)
|
||||
return GSS_C_NO_CREDENTIAL;
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
if (gss_oid_equal(mech_type, mc->gmc_mech_oid))
|
||||
return mc->gmc_cred;
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ gss_inquire_cred(OM_uint32 *minor_status,
|
||||
*minor_status = ENOMEM;
|
||||
return (GSS_S_FAILURE);
|
||||
}
|
||||
SLIST_INIT(&name->gn_mn);
|
||||
HEIM_SLIST_INIT(&name->gn_mn);
|
||||
} else {
|
||||
name = NULL;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ gss_inquire_cred(OM_uint32 *minor_status,
|
||||
if (cred) {
|
||||
struct _gss_mechanism_cred *mc;
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
gss_name_t mc_name;
|
||||
OM_uint32 mc_lifetime;
|
||||
|
||||
@@ -116,7 +116,7 @@ gss_inquire_cred(OM_uint32 *minor_status,
|
||||
mn->gmn_mech = mc->gmc_mech;
|
||||
mn->gmn_mech_oid = mc->gmc_mech_oid;
|
||||
mn->gmn_name = mc_name;
|
||||
SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
} else {
|
||||
mc->gmc_mech->gm_release_name(minor_status,
|
||||
&mc_name);
|
||||
@@ -131,7 +131,7 @@ gss_inquire_cred(OM_uint32 *minor_status,
|
||||
found++;
|
||||
}
|
||||
} else {
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
gss_name_t mc_name;
|
||||
OM_uint32 mc_lifetime;
|
||||
|
||||
@@ -153,7 +153,7 @@ gss_inquire_cred(OM_uint32 *minor_status,
|
||||
mn->gmn_mech = &m->gm_mech;
|
||||
mn->gmn_mech_oid = &m->gm_mech_oid;
|
||||
mn->gmn_name = mc_name;
|
||||
SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
} else if (mc_name) {
|
||||
m->gm_mech.gm_release_name(minor_status,
|
||||
&mc_name);
|
||||
|
@@ -60,7 +60,7 @@ gss_inquire_cred_by_mech(OM_uint32 *minor_status,
|
||||
|
||||
if (cred_handle != GSS_C_NO_CREDENTIAL) {
|
||||
struct _gss_cred *cred = (struct _gss_cred *) cred_handle;
|
||||
SLIST_FOREACH(mcp, &cred->gc_mc, gmc_link)
|
||||
HEIM_SLIST_FOREACH(mcp, &cred->gc_mc, gmc_link)
|
||||
if (mcp->gmc_mech == m)
|
||||
break;
|
||||
if (!mcp)
|
||||
|
@@ -50,7 +50,7 @@ gss_inquire_cred_by_oid (OM_uint32 *minor_status,
|
||||
if (cred == NULL)
|
||||
return GSS_S_NO_CRED;
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
gss_buffer_set_t rset = GSS_C_NO_BUFFER_SET;
|
||||
int i;
|
||||
|
||||
|
@@ -52,7 +52,7 @@ gss_inquire_mechs_for_name(OM_uint32 *minor_status,
|
||||
* name's type is supported by the mechanism. If it is, add
|
||||
* the mechanism to the set.
|
||||
*/
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
major_status = gss_inquire_names_for_mech(minor_status,
|
||||
&m->gm_mech_oid, &name_types);
|
||||
if (major_status) {
|
||||
|
@@ -197,7 +197,7 @@ gsskrb5_register_acceptor_identity(const char *identity)
|
||||
buffer.value = rk_UNCONST(identity);
|
||||
buffer.length = strlen(identity);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -227,7 +227,7 @@ gsskrb5_set_dns_canonicalize(int flag)
|
||||
buffer.value = &b;
|
||||
buffer.length = sizeof(b);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -501,7 +501,7 @@ gsskrb5_set_send_to_kdc(struct gsskrb5_send_to_kdc *c)
|
||||
buffer.length = 0;
|
||||
}
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -532,7 +532,7 @@ gss_krb5_ccache_name(OM_uint32 *minor_status,
|
||||
buffer.value = rk_UNCONST(name);
|
||||
buffer.length = strlen(name);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -820,7 +820,7 @@ gsskrb5_set_default_realm(const char *realm)
|
||||
buffer.value = rk_UNCONST(realm);
|
||||
buffer.length = strlen(realm);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -882,7 +882,7 @@ gsskrb5_set_time_offset(int offset)
|
||||
buffer.value = &o;
|
||||
buffer.length = sizeof(o);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -905,7 +905,7 @@ gsskrb5_get_time_offset(int *offset)
|
||||
buffer.value = &o;
|
||||
buffer.length = sizeof(o);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
maj_stat = m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
@@ -932,7 +932,7 @@ gsskrb5_plugin_register(struct gsskrb5_krb5_plugin *c)
|
||||
buffer.value = c;
|
||||
buffer.length = sizeof(*c);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (m->gm_mech.gm_set_sec_context_option == NULL)
|
||||
continue;
|
||||
m->gm_mech.gm_set_sec_context_option(&junk, NULL,
|
||||
|
@@ -194,7 +194,7 @@ add_builtin(gssapi_mech_interface mech)
|
||||
if (m->gm_name_types == NULL)
|
||||
gss_create_empty_oid_set(&minor_status, &m->gm_name_types);
|
||||
|
||||
SLIST_INSERT_HEAD(&_gss_mechs, m, gm_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&_gss_mechs, m, gm_link);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ _gss_load_mech(void)
|
||||
|
||||
HEIMDAL_MUTEX_lock(&_gss_mech_mutex);
|
||||
|
||||
if (SLIST_FIRST(&_gss_mechs)) {
|
||||
if (HEIM_SLIST_FIRST(&_gss_mechs)) {
|
||||
HEIMDAL_MUTEX_unlock(&_gss_mech_mutex);
|
||||
return;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ _gss_load_mech(void)
|
||||
* Check for duplicates, already loaded mechs.
|
||||
*/
|
||||
found = 0;
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (gss_oid_equal(&m->gm_mech.gm_mech_oid, &mech_oid)) {
|
||||
found = 1;
|
||||
free(mech_oid.elements);
|
||||
@@ -338,7 +338,7 @@ _gss_load_mech(void)
|
||||
OPTSYM(unwrap_iov);
|
||||
OPTSYM(wrap_iov_length);
|
||||
|
||||
SLIST_INSERT_HEAD(&_gss_mechs, m, gm_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&_gss_mechs, m, gm_link);
|
||||
continue;
|
||||
|
||||
bad:
|
||||
@@ -358,7 +358,7 @@ __gss_get_mechanism(gss_const_OID mech)
|
||||
struct _gss_mech_switch *m;
|
||||
|
||||
_gss_load_mech();
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
if (gss_oid_equal(&m->gm_mech.gm_mech_oid, mech))
|
||||
return &m->gm_mech;
|
||||
}
|
||||
|
@@ -249,7 +249,7 @@ gss_inquire_mech_for_saslname(OM_uint32 *minor_status,
|
||||
|
||||
*mech_type = NULL;
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
|
||||
major = mo_value(&m->gm_mech_oid, GSS_C_MA_SASL_MECH_NAME, &name);
|
||||
if (major)
|
||||
@@ -295,7 +295,7 @@ gss_indicate_mechs_by_attrs(OM_uint32 * minor_status,
|
||||
|
||||
_gss_load_mech();
|
||||
|
||||
SLIST_FOREACH(ms, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(ms, &_gss_mechs, gm_link) {
|
||||
gssapi_mech_interface mi = &ms->gm_mech;
|
||||
|
||||
if (desired_mech_attrs) {
|
||||
@@ -388,7 +388,7 @@ gss_inquire_attrs_for_mech(OM_uint32 * minor_status,
|
||||
|
||||
_gss_load_mech();
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link)
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link)
|
||||
add_all_mo(&m->gm_mech, known_mech_attrs, GSS_MO_MA);
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@ _gss_find_mn(OM_uint32 *minor_status, struct _gss_name *name, gss_OID mech,
|
||||
|
||||
*output_mn = NULL;
|
||||
|
||||
SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
if (gss_oid_equal(mech, mn->gmn_mech_oid))
|
||||
break;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ _gss_find_mn(OM_uint32 *minor_status, struct _gss_name *name, gss_OID mech,
|
||||
|
||||
mn->gmn_mech = m;
|
||||
mn->gmn_mech_oid = &m->gm_mech_oid;
|
||||
SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
}
|
||||
*output_mn = mn;
|
||||
return 0;
|
||||
@@ -99,11 +99,11 @@ _gss_make_name(gssapi_mech_interface m, gss_name_t new_mn)
|
||||
return (0);
|
||||
}
|
||||
|
||||
SLIST_INIT(&name->gn_mn);
|
||||
HEIM_SLIST_INIT(&name->gn_mn);
|
||||
mn->gmn_mech = m;
|
||||
mn->gmn_mech_oid = &m->gm_mech_oid;
|
||||
mn->gmn_name = new_mn;
|
||||
SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&name->gn_mn, mn, gmn_link);
|
||||
|
||||
return (name);
|
||||
}
|
||||
|
@@ -59,9 +59,9 @@ gss_release_cred(OM_uint32 *minor_status, gss_cred_id_t *cred_handle)
|
||||
if (*cred_handle == GSS_C_NO_CREDENTIAL)
|
||||
return (GSS_S_COMPLETE);
|
||||
|
||||
while (SLIST_FIRST(&cred->gc_mc)) {
|
||||
mc = SLIST_FIRST(&cred->gc_mc);
|
||||
SLIST_REMOVE_HEAD(&cred->gc_mc, gmc_link);
|
||||
while (HEIM_SLIST_FIRST(&cred->gc_mc)) {
|
||||
mc = HEIM_SLIST_FIRST(&cred->gc_mc);
|
||||
HEIM_SLIST_REMOVE_HEAD(&cred->gc_mc, gmc_link);
|
||||
mc->gmc_mech->gm_release_cred(minor_status, &mc->gmc_cred);
|
||||
free(mc);
|
||||
}
|
||||
|
@@ -58,10 +58,10 @@ gss_release_name(OM_uint32 *minor_status,
|
||||
|
||||
if (name->gn_type.elements)
|
||||
free(name->gn_type.elements);
|
||||
while (SLIST_FIRST(&name->gn_mn)) {
|
||||
while (HEIM_SLIST_FIRST(&name->gn_mn)) {
|
||||
struct _gss_mechanism_name *mn;
|
||||
mn = SLIST_FIRST(&name->gn_mn);
|
||||
SLIST_REMOVE_HEAD(&name->gn_mn, gmn_link);
|
||||
mn = HEIM_SLIST_FIRST(&name->gn_mn);
|
||||
HEIM_SLIST_REMOVE_HEAD(&name->gn_mn, gmn_link);
|
||||
mn->gmn_mech->gm_release_name(minor_status,
|
||||
&mn->gmn_name);
|
||||
free(mn);
|
||||
|
@@ -54,9 +54,9 @@ gss_set_cred_option (OM_uint32 *minor_status,
|
||||
if (cred == NULL)
|
||||
return GSS_S_FAILURE;
|
||||
|
||||
SLIST_INIT(&cred->gc_mc);
|
||||
HEIM_SLIST_INIT(&cred->gc_mc);
|
||||
|
||||
SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {
|
||||
|
||||
if (m->gm_mech.gm_set_cred_option == NULL)
|
||||
continue;
|
||||
@@ -81,7 +81,7 @@ gss_set_cred_option (OM_uint32 *minor_status,
|
||||
continue;
|
||||
}
|
||||
one_ok = 1;
|
||||
SLIST_INSERT_HEAD(&cred->gc_mc, mc, gmc_link);
|
||||
HEIM_SLIST_INSERT_HEAD(&cred->gc_mc, mc, gmc_link);
|
||||
}
|
||||
*cred_handle = (gss_cred_id_t)cred;
|
||||
if (!one_ok) {
|
||||
@@ -91,7 +91,7 @@ gss_set_cred_option (OM_uint32 *minor_status,
|
||||
} else {
|
||||
gssapi_mech_interface m;
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
m = mc->gmc_mech;
|
||||
|
||||
if (m == NULL)
|
||||
|
@@ -63,7 +63,7 @@ gss_store_cred(OM_uint32 *minor_status,
|
||||
return maj;
|
||||
}
|
||||
|
||||
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
|
||||
gssapi_mech_interface m = mc->gmc_mech;
|
||||
|
||||
if (m == NULL || m->gm_store_cred == NULL)
|
||||
|
@@ -30,13 +30,13 @@
|
||||
#include <gssapi_mech.h>
|
||||
|
||||
struct _gss_mech_switch {
|
||||
SLIST_ENTRY(_gss_mech_switch) gm_link;
|
||||
HEIM_SLIST_ENTRY(_gss_mech_switch) gm_link;
|
||||
gss_OID_desc gm_mech_oid;
|
||||
gss_OID_set gm_name_types;
|
||||
void *gm_so;
|
||||
gssapi_mech_interface_desc gm_mech;
|
||||
};
|
||||
SLIST_HEAD(_gss_mech_switch_list, _gss_mech_switch);
|
||||
HEIM_SLIST_HEAD(_gss_mech_switch_list, _gss_mech_switch);
|
||||
extern struct _gss_mech_switch_list _gss_mechs;
|
||||
extern gss_OID_set _gss_mech_oids;
|
||||
|
||||
|
@@ -34,20 +34,20 @@
|
||||
#ifndef _MECHQUEUE_H_
|
||||
#define _MECHQUEUE_H_
|
||||
|
||||
#ifndef SLIST_HEAD
|
||||
#ifndef HEIM_SLIST_HEAD
|
||||
|
||||
/*
|
||||
* Singly-linked List definitions.
|
||||
*/
|
||||
#define SLIST_HEAD(name, type) \
|
||||
#define HEIM_SLIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *slh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define SLIST_HEAD_INITIALIZER(head) \
|
||||
#define HEIM_SLIST_HEAD_INITIALIZER(head) \
|
||||
{ NULL }
|
||||
|
||||
#define SLIST_ENTRY(type) \
|
||||
#define HEIM_SLIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sle_next; /* next element */ \
|
||||
}
|
||||
@@ -55,27 +55,27 @@ struct { \
|
||||
/*
|
||||
* Singly-linked List functions.
|
||||
*/
|
||||
#define SLIST_INIT(head) do { \
|
||||
#define HEIM_SLIST_INIT(head) do { \
|
||||
(head)->slh_first = NULL; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
|
||||
#define HEIM_SLIST_INSERT_AFTER(slistelm, elm, field) do { \
|
||||
(elm)->field.sle_next = (slistelm)->field.sle_next; \
|
||||
(slistelm)->field.sle_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_INSERT_HEAD(head, elm, field) do { \
|
||||
#define HEIM_SLIST_INSERT_HEAD(head, elm, field) do { \
|
||||
(elm)->field.sle_next = (head)->slh_first; \
|
||||
(head)->slh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_REMOVE_HEAD(head, field) do { \
|
||||
#define HEIM_SLIST_REMOVE_HEAD(head, field) do { \
|
||||
(head)->slh_first = (head)->slh_first->field.sle_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_REMOVE(head, elm, type, field) do { \
|
||||
#define HEIM_SLIST_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->slh_first == (elm)) { \
|
||||
SLIST_REMOVE_HEAD((head), field); \
|
||||
HEIM_SLIST_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = (head)->slh_first; \
|
||||
@@ -86,16 +86,16 @@ struct { \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_FOREACH(var, head, field) \
|
||||
#define HEIM_SLIST_FOREACH(var, head, field) \
|
||||
for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
|
||||
|
||||
/*
|
||||
* Singly-linked List access methods.
|
||||
*/
|
||||
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
|
||||
#define SLIST_FIRST(head) ((head)->slh_first)
|
||||
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
|
||||
#define HEIM_SLIST_EMPTY(head) ((head)->slh_first == NULL)
|
||||
#define HEIM_SLIST_FIRST(head) ((head)->slh_first)
|
||||
#define HEIM_SLIST_NEXT(elm, field) ((elm)->field.sle_next)
|
||||
|
||||
#endif /* SLIST_HEAD */
|
||||
#endif /* HEIM_SLIST_HEAD */
|
||||
|
||||
#endif /* !_MECHQUEUE_H_ */
|
||||
|
@@ -28,12 +28,12 @@
|
||||
*/
|
||||
|
||||
struct _gss_mechanism_name {
|
||||
SLIST_ENTRY(_gss_mechanism_name) gmn_link;
|
||||
HEIM_SLIST_ENTRY(_gss_mechanism_name) gmn_link;
|
||||
gssapi_mech_interface gmn_mech; /* mechanism ops for MN */
|
||||
gss_OID gmn_mech_oid; /* mechanism oid for MN */
|
||||
gss_name_t gmn_name; /* underlying MN */
|
||||
};
|
||||
SLIST_HEAD(_gss_mechanism_name_list, _gss_mechanism_name);
|
||||
HEIM_SLIST_HEAD(_gss_mechanism_name_list, _gss_mechanism_name);
|
||||
|
||||
struct _gss_name {
|
||||
gss_OID_desc gn_type; /* type of name */
|
||||
|
Reference in New Issue
Block a user