From: Andreas Schneider Date: Wed, 26 Jan 2022 07:44:13 +0000 (+0100) Subject: s4:kdc: Translate HDB flags to SDB flags X-Git-Tag: tevent-0.12.0~829 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6063e8016fccbefd1c3fe378e3807c77bc04e4ec;p=thirdparty%2Fsamba.git s4:kdc: Translate HDB flags to SDB flags We used to have a 1 to 1 mapping, but now we have a conflict with these: #define SDB_F_FORCE_CANON 16384 #define HDB_F_PRECHECK 16384 We currently don't really care about HDB_F_PRECHECK, so we can just filter it out. In the long run we may change the SDB flags space to uint64... BUG: https://bugzilla.samba.org/show_bug.cgi?id=14960 Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Fri Jan 28 13:33:22 UTC 2022 on sn-devel-184 --- diff --git a/source4/kdc/hdb-samba4.c b/source4/kdc/hdb-samba4.c index 7477c0f9c11..71260d3ed0a 100644 --- a/source4/kdc/hdb-samba4.c +++ b/source4/kdc/hdb-samba4.c @@ -223,6 +223,8 @@ static krb5_error_code hdb_samba4_fetch_kvno(krb5_context context, HDB *db, struct samba_kdc_db_context *kdc_db_ctx; struct sdb_entry_ex sdb_entry_ex = {}; krb5_error_code code, ret; + uint32_t sflags; + kdc_db_ctx = talloc_get_type_abort(db->hdb_db, struct samba_kdc_db_context); @@ -232,10 +234,12 @@ static krb5_error_code hdb_samba4_fetch_kvno(krb5_context context, HDB *db, entry_ex); } + sflags = (flags & SDB_F_HDB_MASK); + ret = samba_kdc_fetch(context, kdc_db_ctx, principal, - flags, + sflags, kvno, &sdb_entry_ex); switch (ret) {