summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/ctdbd_conn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 18e9879601..46936c5f39 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -820,13 +820,16 @@ NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn,
NTSTATUS status;
TDB_DATA data;
int32_t cstatus;
+ bool persistent = (tdb_flags & TDB_CLEAR_IF_FIRST) == 0;
data.dptr = (uint8_t*)name;
data.dsize = strlen(name)+1;
status = ctdbd_control(conn, CTDB_CURRENT_NODE,
- CTDB_CONTROL_DB_ATTACH, 0, data,
- NULL, &data, &cstatus);
+ persistent
+ ? CTDB_CONTROL_DB_ATTACH_PERSISTENT
+ : CTDB_CONTROL_DB_ATTACH,
+ 0, data, NULL, &data, &cstatus);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, (__location__ " ctdb_control for db_attach "
"failed: %s\n", nt_errstr(status)));