From: Stefan Metzmacher Date: Sat, 18 Jul 2026 11:36:03 +0000 (+0200) Subject: s3:dbwrap_open: protect db_open() against recursive calls X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09acd0cf758f331045ada99f9becf496787f22e4;p=thirdparty%2Fsamba.git s3:dbwrap_open: protect db_open() against recursive calls Callers need to use db_open_ex() instead. Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index 7630b5965ed..eaf909281f1 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -251,7 +251,11 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, uint64_t dbwrap_flags) { struct db_context *db = NULL; + static bool busy; + SMB_ASSERT(!busy); + + busy = true; db = db_open_ex(mem_ctx, NULL, /* ev_ctx_ex */ NULL, /* msg_ctx_ex */ @@ -263,6 +267,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, mode, lock_order, dbwrap_flags); + busy = false; return db; }