From fe61009002db897fb8632954af8203de28c24d7d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 30 May 2024 11:43:04 +1200 Subject: [PATCH] kdc: Mark KDC sam.ldb as not to use ldb_wrap cache 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 Reviewed-by: Jo Sutton --- source4/kdc/db-glue.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c index 070a97ad74d..01b19209cf5 100644 --- a/source4/kdc/db-glue.c +++ b/source4/kdc/db-glue.c @@ -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);