]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
kdc: Mark KDC sam.ldb as not to use ldb_wrap cache
authorAndrew Bartlett <abartlet@samba.org>
Wed, 29 May 2024 23:43:04 +0000 (11:43 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 10 Jun 2024 04:27:30 +0000 (04:27 +0000)
This will ensure that the time which will be is passed in an opaque is
not used by other parts of Samba

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
source4/kdc/db-glue.c

index 070a97ad74d11e12f2ced2ad5548416b002946d2..01b19209cf54881b0724509f43cb28e13fe108dd 100644 (file)
@@ -4037,7 +4037,10 @@ NTSTATUS samba_kdc_setup_db_ctx(TALLOC_CTX *mem_ctx, struct samba_kdc_base_conte
                /*
                 * Caller is responsible for lifetimes.  In reality
                 * the whole thing is destroyed before leaving the
-                * function the samdb was passed into
+                * function the samdb was passed into.
+                *
+                * We assume this DB is created from python and so
+                * can't be in the ldb_wrap cache.
                 */
                kdc_db_ctx->samdb = base_ctx->samdb;
        } else {
@@ -4054,7 +4057,7 @@ NTSTATUS samba_kdc_setup_db_ctx(TALLOC_CTX *mem_ctx, struct samba_kdc_base_conte
                                                  base_ctx->lp_ctx,
                                                  session_info,
                                                  NULL,
-                                                 0);
+                                                 SAMBA_LDB_WRAP_CONNECT_FLAG_NO_SHARE_CONTEXT);
                if (kdc_db_ctx->samdb == NULL) {
                        DBG_WARNING("Cannot open samdb for KDC backend!\n");
                        talloc_free(kdc_db_ctx);