1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:dbwrap: add dbwrap_tdb_require_mutexes:*= option

This is similar to dbwrap_tdb_mutexes:*= (which is autodetected by default),
but dbwrap_tdb_require_mutexes is off by default.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Stefan Metzmacher 2016-01-16 10:19:23 +01:00 committed by Ralph Boehme
parent 00f4bf32db
commit 719428f587

View File

@ -97,6 +97,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
if (tdb_flags & TDB_CLEAR_IF_FIRST) {
const char *base;
bool try_mutex = false;
bool require_mutex = false;
base = strrchr_m(name, '/');
if (base != NULL) {
@ -111,6 +112,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
if (try_mutex && tdb_runtime_check_for_robust_mutexes()) {
tdb_flags |= TDB_MUTEX_LOCKING;
}
require_mutex = lp_parm_bool(-1, "dbwrap_tdb_require_mutexes",
"*", require_mutex);
require_mutex = lp_parm_bool(-1, "dbwrap_tdb_require_mutexes",
base, require_mutex);
if (require_mutex) {
tdb_flags |= TDB_MUTEX_LOCKING;
}
}
sockname = lp_ctdbd_socket();