diff options
author | Gregor Beck <gbeck@sernet.de> | 2012-06-21 10:26:03 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-07-03 11:30:04 +0200 |
commit | 3fd0b8a5a55fdaea09ca23bb8f3738f5c70adf7c (patch) | |
tree | e4cd731c9af88ddbf97302116d1a1d99fdc69ce7 | |
parent | 694c1b269edc95df446b2e171919be0c266383c4 (diff) | |
download | samba-3fd0b8a5a55fdaea09ca23bb8f3738f5c70adf7c.tar.gz samba-3fd0b8a5a55fdaea09ca23bb8f3738f5c70adf7c.tar.xz samba-3fd0b8a5a55fdaea09ca23bb8f3738f5c70adf7c.zip |
ctdbd: refuse attaching with "persistent" to a non-persistent db and v.v.
Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 1ebbaa620b3cfb9ff373828e4aaa84246cf3ec25)
-rw-r--r-- | ctdb/server/ctdb_ltdb_server.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c index 0aa378be09..00d5566dc2 100644 --- a/ctdb/server/ctdb_ltdb_server.c +++ b/ctdb/server/ctdb_ltdb_server.c @@ -1116,6 +1116,12 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, /* see if we already have this name */ db = ctdb_db_handle(ctdb, db_name); if (db) { + if (db->persistent != persistent) { + DEBUG(DEBUG_ERR, ("ERROR: DB Attach %spersistent to %spersistent " + "database %s", persistent ? "" : "non-", + db-> persistent ? "" : "non-", db_name)); + return -1; + } outdata->dptr = (uint8_t *)&db->db_id; outdata->dsize = sizeof(db->db_id); tdb_add_flags(db->ltdb->tdb, tdb_flags); |