]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
don't allow setrecmaster while not frozen
authorAndrew Tridgell <tridge@samba.org>
Mon, 14 May 2007 03:48:14 +0000 (13:48 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 14 May 2007 03:48:14 +0000 (13:48 +1000)
(This used to be ctdb commit e84b05ba6062ffc45b7f3c23e88feef1d39069c4)

ctdb/common/ctdb_control.c

index 0ec0a384595a238e5dda143250bcbf57ae535a36..fab66c855af6e661480860f4f4e4670b454eea35 100644 (file)
@@ -123,8 +123,12 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
        }
 
        case CTDB_CONTROL_SET_RECMASTER: {
+               CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
+               if (ctdb->freeze_mode != CTDB_FREEZE_FROZEN) {
+                       DEBUG(0,("Attempt to set recmaster when not frozen\n"));
+                       return -1;
+               }
                ctdb->recovery_master = ((uint32_t *)(&indata.dptr[0]))[0];
-
                return 0;
        }