mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
ctdb-daemon: Don't allow attach from recovery if recovery is not active
Neither the recovery daemon nor the recovery helper should attach databases outside of the recovery process. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
052f1bdb9c
commit
147afe77de
@ -1135,6 +1135,13 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((c->flags & CTDB_CTRL_FLAG_ATTACH_RECOVERY) &&
|
||||||
|
ctdb->recovery_mode != CTDB_RECOVERY_ACTIVE) {
|
||||||
|
DBG_ERR("Attach from recovery refused because "
|
||||||
|
"recovery is not active\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(c->flags & CTDB_CTRL_FLAG_ATTACH_RECOVERY) &&
|
if (!(c->flags & CTDB_CTRL_FLAG_ATTACH_RECOVERY) &&
|
||||||
(ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE ||
|
(ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE ||
|
||||||
ctdb->runstate < CTDB_RUNSTATE_STARTUP)) {
|
ctdb->runstate < CTDB_RUNSTATE_STARTUP)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user