]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Translate HDB flags to SDB flags
authorAndreas Schneider <asn@samba.org>
Wed, 26 Jan 2022 07:44:13 +0000 (08:44 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 28 Jan 2022 13:33:22 +0000 (13:33 +0000)
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 <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 28 13:33:22 UTC 2022 on sn-devel-184

source4/kdc/hdb-samba4.c

index 7477c0f9c114831d9d94b1167d64b7ebc6c8ef16..71260d3ed0aba18fec5273a8a1d077aa261517c8 100644 (file)
@@ -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) {