return NULL;
}
+#ifdef HAVE_CTDB_WANT_READONLY_DECL
+ if (!result->persistent &&
+ (dbwrap_flags & DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESS))
+ {
+ TDB_DATA indata;
+
+ indata = make_tdb_data((uint8_t *)&db_ctdb->db_id,
+ sizeof(db_ctdb->db_id));
+
+ status = ctdbd_control_local(
+ conn, CTDB_CONTROL_SET_DB_READONLY, 0, 0, indata,
+ NULL, NULL, &cstatus);
+ if (!NT_STATUS_IS_OK(status) || (cstatus != 0)) {
+ DEBUG(1, ("CTDB_CONTROL_SET_DB_READONLY failed: "
+ "%s, %d\n", nt_errstr(status), cstatus));
+ TALLOC_FREE(result);
+ return NULL;
+ }
+ }
+#endif
+
lp_ctx = loadparm_init_s3(db_path, loadparm_s3_helpers());
db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size, tdb_flags,