summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/gssapi
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-01-31 15:59:06 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-02-02 15:19:03 +1100
commit2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2 (patch)
treece681728eb91875b60b70d34247a0f07772ec411 /source4/heimdal/lib/gssapi
parent3d4a9ddc244bd4937af9ff1c6e898ab45a7d28b5 (diff)
downloadsamba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.tar.gz
samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.tar.bz2
samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.zip
s4:heimdal: import lorikeet-heimdal-201101310455 (commit aa88eb1a05c4985cc23fb65fc1bad75bdce01c1f)
Diffstat (limited to 'source4/heimdal/lib/gssapi')
-rw-r--r--source4/heimdal/lib/gssapi/gssapi/gssapi.h9
-rwxr-xr-xsource4/heimdal/lib/gssapi/krb5/cfx.c8
-rw-r--r--source4/heimdal/lib/gssapi/mech/context.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/cred.h4
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_accept_sec_context.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_acquire_cred.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_add_cred.c8
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_aeap.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_canonicalize_name.c4
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_compare_name.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_cred.c10
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_display_name.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_duplicate_name.c8
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_export_name.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_import_name.c8
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_indicate_mechs.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_init_sec_context.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_inquire_cred.c10
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c2
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_krb5.c16
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_mech_switch.c16
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_mo.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_names.c8
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_release_cred.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_release_name.c6
-rw-r--r--source4/heimdal/lib/gssapi/mech/gss_set_cred_option.c8
-rw-r--r--source4/heimdal/lib/gssapi/mech/mech_switch.h4
-rw-r--r--source4/heimdal/lib/gssapi/mech/mechqueue.h30
-rw-r--r--source4/heimdal/lib/gssapi/mech/name.h4
31 files changed, 109 insertions, 104 deletions
diff --git a/source4/heimdal/lib/gssapi/gssapi/gssapi.h b/source4/heimdal/lib/gssapi/gssapi/gssapi.h
index 12833ebe14..c67b0a80d7 100644
--- a/source4/heimdal/lib/gssapi/gssapi/gssapi.h
+++ b/source4/heimdal/lib/gssapi/gssapi/gssapi.h
@@ -261,9 +261,12 @@ typedef OM_uint32 gss_qop_t;
#define GSS_IOV_BUFFER_TYPE_STREAM 10
#define GSS_IOV_BUFFER_TYPE_SIGN_ONLY 11
-#define GSS_IOV_BUFFER_TYPE_FLAG_MASK 0xffff0000
-#define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATE 0x00010000
-#define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED 0x00020000
+#define GSS_IOV_BUFFER_TYPE_FLAG_MASK 0xffff0000
+#define GSS_IOV_BUFFER_FLAG_ALLOCATE 0x00010000
+#define GSS_IOV_BUFFER_FLAG_ALLOCATED 0x00020000
+
+#define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATE 0x00010000 /* old name */
+#define GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED 0x00020000 /* old name */
#define GSS_IOV_BUFFER_TYPE(_t) ((_t) & ~GSS_IOV_BUFFER_TYPE_FLAG_MASK)
#define GSS_IOV_BUFFER_FLAGS(_t) ((_t) & GSS_IOV_BUFFER_TYPE_FLAG_MASK)
diff --git a/source4/heimdal/lib/gssapi/krb5/cfx.c b/source4/heimdal/lib/gssapi/krb5/cfx.c
index 1a6e975279..1189718adc 100755
--- a/source4/heimdal/lib/gssapi/krb5/cfx.c
+++ b/source4/heimdal/lib/gssapi/krb5/cfx.c
@@ -216,7 +216,7 @@ _gk_find_buffer(gss_iov_buffer_desc *iov, int iov_count, OM_uint32 type)
OM_uint32
_gk_allocate_buffer(OM_uint32 *minor_status, gss_iov_buffer_desc *buffer, size_t size)
{
- if (buffer->type & GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED) {
+ if (buffer->type & GSS_IOV_BUFFER_FLAG_ALLOCATED) {
if (buffer->buffer.length == size)
return GSS_S_COMPLETE;
free(buffer->buffer.value);
@@ -228,7 +228,7 @@ _gk_allocate_buffer(OM_uint32 *minor_status, gss_iov_buffer_desc *buffer, size_t
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
- buffer->type |= GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED;
+ buffer->type |= GSS_IOV_BUFFER_FLAG_ALLOCATED;
return GSS_S_COMPLETE;
}
@@ -391,7 +391,7 @@ _gssapi_wrap_cfx_iov(OM_uint32 *minor_status,
rrc -= ec;
gsshsize += gsstsize;
gsstsize = 0;
- } else if (GSS_IOV_BUFFER_FLAGS(trailer->type) & GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATE) {
+ } else if (GSS_IOV_BUFFER_FLAGS(trailer->type) & GSS_IOV_BUFFER_FLAG_ALLOCATE) {
major_status = _gk_allocate_buffer(minor_status, trailer, gsstsize);
if (major_status)
goto failure;
@@ -406,7 +406,7 @@ _gssapi_wrap_cfx_iov(OM_uint32 *minor_status,
*
*/
- if (GSS_IOV_BUFFER_FLAGS(header->type) & GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATE) {
+ if (GSS_IOV_BUFFER_FLAGS(header->type) & GSS_IOV_BUFFER_FLAG_ALLOCATE) {
major_status = _gk_allocate_buffer(minor_status, header, gsshsize);
if (major_status != GSS_S_COMPLETE)
goto failure;
diff --git a/source4/heimdal/lib/gssapi/mech/context.c b/source4/heimdal/lib/gssapi/mech/context.c
index 96e5edc32b..5ea0ac466b 100644
--- a/source4/heimdal/lib/gssapi/mech/context.c
+++ b/source4/heimdal/lib/gssapi/mech/context.c
@@ -85,17 +85,19 @@ _gss_mg_get_error(const gss_OID mech, OM_uint32 type,
case GSS_C_GSS_CODE: {
if (value != mg->maj_stat || mg->maj_error.length == 0)
break;
- string->value = malloc(mg->maj_error.length);
+ string->value = malloc(mg->maj_error.length + 1);
string->length = mg->maj_error.length;
memcpy(string->value, mg->maj_error.value, mg->maj_error.length);
+ ((char *) string->value)[string->length] = '\0';
return GSS_S_COMPLETE;
}
case GSS_C_MECH_CODE: {
if (value != mg->min_stat || mg->min_error.length == 0)
break;
- string->value = malloc(mg->min_error.length);
+ string->value = malloc(mg->min_error.length + 1);
string->length = mg->min_error.length;
memcpy(string->value, mg->min_error.value, mg->min_error.length);
+ ((char *) string->value)[string->length] = '\0';
return GSS_S_COMPLETE;
}
}
diff --git a/source4/heimdal/lib/gssapi/mech/cred.h b/source4/heimdal/lib/gssapi/mech/cred.h
index 01bd882dda..adffe6893e 100644
--- a/source4/heimdal/lib/gssapi/mech/cred.h
+++ b/source4/heimdal/lib/gssapi/mech/cred.h
@@ -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;
diff --git a/source4/heimdal/lib/gssapi/mech/gss_accept_sec_context.c b/source4/heimdal/lib/gssapi/mech/gss_accept_sec_context.c
index 19f3bc4bf8..92d7e7f05d 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_accept_sec_context.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_accept_sec_context.c
@@ -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;
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_acquire_cred.c b/source4/heimdal/lib/gssapi/mech/gss_acquire_cred.c
index 416407a7bf..c9900148c2 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_acquire_cred.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_acquire_cred.c
@@ -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);
diff --git a/source4/heimdal/lib/gssapi/mech/gss_add_cred.c b/source4/heimdal/lib/gssapi/mech/gss_add_cred.c
index 56fb8ec6a9..19deea5b06 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_add_cred.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_add_cred.c
@@ -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);
diff --git a/source4/heimdal/lib/gssapi/mech/gss_aeap.c b/source4/heimdal/lib/gssapi/mech/gss_aeap.c
index e98ba970d1..141b6ae5ac 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_aeap.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_aeap.c
@@ -157,7 +157,7 @@ gss_wrap_iov_length(OM_uint32 * minor_status,
/**
* Free all buffer allocated by gss_wrap_iov() or gss_unwrap_iov() by
- * looking at the GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED flag.
+ * looking at the GSS_IOV_BUFFER_FLAG_ALLOCATED flag.
*
* @ingroup gssapi
*/
@@ -176,10 +176,10 @@ gss_release_iov_buffer(OM_uint32 *minor_status,
return GSS_S_CALL_INACCESSIBLE_READ;
for (i = 0; i < iov_count; i++) {
- if ((iov[i].type & GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED) == 0)
+ if ((iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATED) == 0)
continue;
gss_release_buffer(&junk, &iov[i].buffer);
- iov[i].type &= ~GSS_IOV_BUFFER_TYPE_FLAG_ALLOCATED;
+ iov[i].type &= ~GSS_IOV_BUFFER_FLAG_ALLOCATED;
}
return GSS_S_COMPLETE;
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_canonicalize_name.c b/source4/heimdal/lib/gssapi/mech/gss_canonicalize_name.c
index fba35c5379..e87931dc78 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_canonicalize_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_canonicalize_name.c
@@ -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;
diff --git a/source4/heimdal/lib/gssapi/mech/gss_compare_name.c b/source4/heimdal/lib/gssapi/mech/gss_compare_name.c
index 14593f6def..70b4b1c206 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_compare_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_compare_name.c
@@ -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,
diff --git a/source4/heimdal/lib/gssapi/mech/gss_cred.c b/source4/heimdal/lib/gssapi/mech/gss_cred.c
index b52015b6de..b8fa11185a 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_cred.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_cred.c
@@ -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;
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_display_name.c b/source4/heimdal/lib/gssapi/mech/gss_display_name.c
index 599e79861a..524a586fbe 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_display_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_display_name.c
@@ -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,
diff --git a/source4/heimdal/lib/gssapi/mech/gss_duplicate_name.c b/source4/heimdal/lib/gssapi/mech/gss_duplicate_name.c
index 3d3a56802f..053825bbc3 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_duplicate_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_duplicate_name.c
@@ -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);
}
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_export_name.c b/source4/heimdal/lib/gssapi/mech/gss_export_name.c
index 6bc5ee8d1c..3e6e626819 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_export_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_export_name.c
@@ -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);
diff --git a/source4/heimdal/lib/gssapi/mech/gss_import_name.c b/source4/heimdal/lib/gssapi/mech/gss_import_name.c
index 90dc0c1e94..574c058fc2 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_import_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_import_name.c
@@ -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;
diff --git a/source4/heimdal/lib/gssapi/mech/gss_indicate_mechs.c b/source4/heimdal/lib/gssapi/mech/gss_indicate_mechs.c
index 8560bc7c41..59a1dcf22b 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_indicate_mechs.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_indicate_mechs.c
@@ -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);
diff --git a/source4/heimdal/lib/gssapi/mech/gss_init_sec_context.c b/source4/heimdal/lib/gssapi/mech/gss_init_sec_context.c
index 5da035d15a..cf111ecbae 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_init_sec_context.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_init_sec_context.c
@@ -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;
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_inquire_cred.c b/source4/heimdal/lib/gssapi/mech/gss_inquire_cred.c
index 50d9c0b8da..1db0f23303 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_inquire_cred.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_inquire_cred.c
@@ -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);
diff --git a/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c b/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c
index f71bd6993f..e7746e4657 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.c
@@ -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)
diff --git a/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c b/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c
index 72d3048039..900370a5db 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.c
@@ -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;
diff --git a/source4/heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c b/source4/heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c
index 1ad7b58dbb..f8eab82dc1 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.c
@@ -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) {
diff --git a/source4/heimdal/lib/gssapi/mech/gss_krb5.c b/source4/heimdal/lib/gssapi/mech/gss_krb5.c
index f4290a2a5a..594b41ef8e 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_krb5.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_krb5.c
@@ -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,
diff --git a/source4/heimdal/lib/gssapi/mech/gss_mech_switch.c b/source4/heimdal/lib/gssapi/mech/gss_mech_switch.c
index b1368db91c..a68d345e30 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_mech_switch.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_mech_switch.c
@@ -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);
@@ -276,7 +276,11 @@ _gss_load_mech(void)
#define RTLD_LOCAL 0
#endif
- so = dlopen(lib, RTLD_LAZY | RTLD_LOCAL);
+#ifndef RTLD_GROUP
+#define RTLD_GROUP 0
+#endif
+
+ so = dlopen(lib, RTLD_LAZY | RTLD_LOCAL | RTLD_GROUP);
if (!so) {
/* fprintf(stderr, "dlopen: %s\n", dlerror()); */
free(mech_oid.elements);
@@ -338,7 +342,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 +362,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;
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_mo.c b/source4/heimdal/lib/gssapi/mech/gss_mo.c
index 354229f7ae..31235f54d5 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_mo.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_mo.c
@@ -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);
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_names.c b/source4/heimdal/lib/gssapi/mech/gss_names.c
index 6a7ccd5c71..4b470c775f 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_names.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_names.c
@@ -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);
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_release_cred.c b/source4/heimdal/lib/gssapi/mech/gss_release_cred.c
index 591ef49ab2..341f9f658c 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_release_cred.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_release_cred.c
@@ -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);
}
diff --git a/source4/heimdal/lib/gssapi/mech/gss_release_name.c b/source4/heimdal/lib/gssapi/mech/gss_release_name.c
index 28fb75d966..759eaec4c3 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_release_name.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_release_name.c
@@ -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);
diff --git a/source4/heimdal/lib/gssapi/mech/gss_set_cred_option.c b/source4/heimdal/lib/gssapi/mech/gss_set_cred_option.c
index adae7a622e..62be485a07 100644
--- a/source4/heimdal/lib/gssapi/mech/gss_set_cred_option.c
+++ b/source4/heimdal/lib/gssapi/mech/gss_set_cred_option.c
@@ -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)
diff --git a/source4/heimdal/lib/gssapi/mech/mech_switch.h b/source4/heimdal/lib/gssapi/mech/mech_switch.h
index 56e3b7dea7..7ed3d4d4aa 100644
--- a/source4/heimdal/lib/gssapi/mech/mech_switch.h
+++ b/source4/heimdal/lib/gssapi/mech/mech_switch.h
@@ -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;
diff --git a/source4/heimdal/lib/gssapi/mech/mechqueue.h b/source4/heimdal/lib/gssapi/mech/mechqueue.h
index 7a05c94bf8..95941bab7e 100644
--- a/source4/heimdal/lib/gssapi/mech/mechqueue.h
+++ b/source4/heimdal/lib/gssapi/mech/mechqueue.h
@@ -34,20 +34,18 @@
#ifndef _MECHQUEUE_H_
#define _MECHQUEUE_H_
-#ifndef 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 +53,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 +84,14 @@ 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)
-
-#endif /* SLIST_HEAD */
+#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 /* !_MECHQUEUE_H_ */
diff --git a/source4/heimdal/lib/gssapi/mech/name.h b/source4/heimdal/lib/gssapi/mech/name.h
index baf8e06147..4baeebf36a 100644
--- a/source4/heimdal/lib/gssapi/mech/name.h
+++ b/source4/heimdal/lib/gssapi/mech/name.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 */