Cluster: don't allow CLUSTER SETSLOT with slaves.

This commit is contained in:
antirez 2016-01-11 15:00:45 +01:00
parent f43c794b0b
commit 524be1e465

View File

@ -3940,6 +3940,11 @@ void clusterCommand(client *c) {
int slot;
clusterNode *n;
if (nodeIsSlave(myself)) {
addReplyError(c,"Please use SETSLOT only with masters.");
return;
}
if ((slot = getSlotOrReply(c,c->argv[2])) == -1) return;
if (!strcasecmp(c->argv[3]->ptr,"migrating") && c->argc == 5) {