From: Volker Lendecke Date: Thu, 21 Nov 2019 14:20:33 +0000 (+0100) Subject: lib: Allow DBWRAP_LOCK_ORDER_NONE in db_open() X-Git-Tag: ldb-2.2.0~497 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66d62ed7978cc0bc1d7bb6c495e32738802f4420;p=thirdparty%2Fsamba.git lib: Allow DBWRAP_LOCK_ORDER_NONE in db_open() locking.tdb will not have a LOCK_ORDER anymore, this will be done by the code in g_lock.c. We need to allow opening a database with dbwrap without having a lock order. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index eac52c5a431..e67341607a4 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -67,7 +67,8 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, const char *base; struct loadparm_context *lp_ctx = NULL; - if (!DBWRAP_LOCK_ORDER_VALID(lock_order)) { + if ((lock_order != DBWRAP_LOCK_ORDER_NONE) && + !DBWRAP_LOCK_ORDER_VALID(lock_order)) { errno = EINVAL; return NULL; }