gss: use tail queue instead of singly linked list in mechglue

The GSS mechglue uses singly linked lists for mechanisms and mechanism objects,
to which new entries are inserted at the head. This breaks ordering of
mechanisms specified in OID sets and in /etc/gss/mech, as they will be back to
front. Use a tail queue instead so that new entries are inserted at the end.
This commit is contained in:
Luke Howard
2019-12-28 16:30:55 +11:00
parent d7138cfbe7
commit 31af9ba703
42 changed files with 199 additions and 216 deletions

View File

@@ -132,14 +132,14 @@ gss_duplicate_cred(OM_uint32 *minor_status,
*minor_status = 0;
major_status = GSS_S_NO_CRED;
HEIM_SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
HEIM_TAILQ_FOREACH(mc, &cred->gc_mc, gmc_link) {
struct _gss_mechanism_cred *copy_mc;
major_status = copy_cred_element(minor_status, mc, &copy_mc);
if (major_status != GSS_S_COMPLETE)
break;
HEIM_SLIST_INSERT_HEAD(&new_cred->gc_mc, copy_mc, gmc_link);
HEIM_TAILQ_INSERT_TAIL(&new_cred->gc_mc, copy_mc, gmc_link);
}
if (major_status != GSS_S_COMPLETE) {