summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-02-21 17:30:53 +1100
committerAmitay Isaacs <amitay@samba.org>2012-03-05 02:47:36 +0100
commit5c5111ca0319ad3fdd2c27a0bd3c06b576921d08 (patch)
treea525ea8eac2f854fe41a1dfbe0b69e63753a40bb /source3/lib/dbwrap
parent5bda06877303b4ac01081b12f889db1409c0a6f6 (diff)
downloadsamba-5c5111ca0319ad3fdd2c27a0bd3c06b576921d08.tar.gz
samba-5c5111ca0319ad3fdd2c27a0bd3c06b576921d08.tar.bz2
samba-5c5111ca0319ad3fdd2c27a0bd3c06b576921d08.zip
s3-ctdb: Enable CTDB readonly support only if CTDB supports it
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Mon Mar 5 02:47:36 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index a05f9554b7..2e0146fdb0 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1012,6 +1012,7 @@ static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only)
if (ctdb_data.dsize < sizeof(struct ctdb_ltdb_header))
return false;
+#ifdef HAVE_CTDB_WANT_READONLY_DECL
hdr = (struct ctdb_ltdb_header *)ctdb_data.dptr;
if (hdr->dmaster != get_my_vnn()) {
/* If we're not dmaster, it must be r/o copy. */
@@ -1020,6 +1021,9 @@ static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only)
/* If we want write access, noone can have r/o copies. */
return read_only || !(hdr->flags & CTDB_REC_RO_HAVE_DELEGATIONS);
+#else
+ return !read_only;
+#endif
}
static struct db_record *fetch_locked_internal(struct db_ctdb_ctx *ctx,