third_party/heimdal: Introduce macro for common plugin structure elements
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 21 Oct 2022 21:11:53 +0000 (10:11 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 2 Nov 2022 04:23:34 +0000 (04:23 +0000)
commit074e92849715ed3485703cfbba3771d405e4e78a
treec7cabefefa32f0524cd0721df10be0766595ed5e
parent6353f9e9c47d02dc0e18585bfaad48b2ce85441d
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>
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