summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-07-11 21:35:17 +0200
committerKarolin Seeger <kseeger@samba.org>2017-07-24 22:00:38 +0200
commit74393944095b361859265d26d1dc07b2cc808241 (patch)
treeb06a2fb148bbe2e9a5d2e6bf57d6daa5d651112f /source3/lib
parenta577510d348ba9be9653a75363eeb2e400d1a425 (diff)
downloadsamba-74393944095b361859265d26d1dc07b2cc808241.tar.gz
dbwrap: Ask CTDB for local tdb open flags
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Jul 12 13:25:11 CEST 2017 on sn-devel-144 (cherry picked from commit de9d21957706bd5d811db01b7b5d88a0bb17034b)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 07e35f8ffb0..6bdaab000a9 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1840,9 +1840,25 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
result->persistent = persistent;
result->lock_order = lock_order;
- /* only pass through specific flags */
- tdb_flags &= TDB_SEQNUM|TDB_VOLATILE|
- TDB_MUTEX_LOCKING|TDB_CLEAR_IF_FIRST;
+ data.dptr = (uint8_t *)&db_ctdb->db_id;
+ data.dsize = sizeof(db_ctdb->db_id);
+
+ ret = ctdbd_control_local(conn, CTDB_CONTROL_DB_OPEN_FLAGS,
+ 0, 0, data, NULL, &data, &cstatus);
+ if (ret != 0) {
+ DBG_ERR(" ctdb control for db_open_flags "
+ "failed: %s\n", strerror(ret));
+ TALLOC_FREE(result);
+ return NULL;
+ }
+
+ if (cstatus != 0 || data.dsize != sizeof(int)) {
+ DBG_ERR("ctdb_control for db_open_flags failed\n");
+ TALLOC_FREE(result);
+ return NULL;
+ }
+
+ tdb_flags = *(int *)data.dptr;
if (!result->persistent) {
ret = ctdb_async_ctx_init(NULL, messaging_tevent_context(msg_ctx));