]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Allow DBWRAP_LOCK_ORDER_NONE in db_open()
authorVolker Lendecke <vl@samba.org>
Thu, 21 Nov 2019 14:20:33 +0000 (15:20 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 15 May 2020 00:48:32 +0000 (00:48 +0000)
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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/dbwrap/dbwrap_open.c

index eac52c5a4317afd3ce208dea818404f60a2c606f..e67341607a40905e5fdcd7fe66b905aa71c4bbf5 100644 (file)
@@ -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;
        }