third_party/heimdal: Introduce macro for common plugin structure elements
commiteeea6587e92daf792c5ca382d7c03c40e6ccd621
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 21 Oct 2022 21:11:53 +0000 (22 10:11 +1300)
committerJule Anger <janger@samba.org>
Tue, 8 Nov 2022 13:11:15 +0000 (8 13:11 +0000)
tree5e7c5cb36d7f32ccd8a54c9c8cdc5ccc24570e8f
parent618395a7eafbb6224047610659c2d343318a1d33
third_party/heimdal: Introduce macro for common plugin structure elements

Heimdal's HDB plugin interface, and hence Samba's KDC that depends upon
it, doesn't work on 32-bit builds due to structure fields being arranged
in the wrong order. This problem presents itself in the form of
segmentation faults on 32-bit systems, but goes unnoticed on 64-bit
builds thanks to extra structure padding absorbing the errant fields.

This commit reorders the HDB plugin structure fields to prevent crashes
and introduces a common macro to ensure every plugin presents a
consistent interface.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15110

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 074e92849715ed3485703cfbba3771d405e4e78a)
17 files changed:
third_party/heimdal/kdc/csr_authorizer_plugin.h
third_party/heimdal/kdc/gss_preauth_authorizer_plugin.h
third_party/heimdal/kdc/kdc-plugin.h
third_party/heimdal/kdc/token_validator_plugin.h
third_party/heimdal/lib/base/common_plugin.h
third_party/heimdal/lib/base/heimbase-svc.h
third_party/heimdal/lib/base/plugin.c
third_party/heimdal/lib/hdb/hdb-ldap.c
third_party/heimdal/lib/hdb/hdb.c
third_party/heimdal/lib/hdb/hdb.h
third_party/heimdal/lib/hdb/test_namespace.c
third_party/heimdal/lib/kadm5/kadm5-hook.h
third_party/heimdal/lib/krb5/an2ln_plugin.h
third_party/heimdal/lib/krb5/db_plugin.h
third_party/heimdal/lib/krb5/kuserok_plugin.h
third_party/heimdal/lib/krb5/locate_plugin.h
third_party/heimdal/lib/krb5/send_to_kdc_plugin.h