Added additional validation for cluster SETSLOT
@@ -4652,6 +4652,10 @@ NULL
(char*)c->argv[4]->ptr);
return;
}
+ if (nodeIsSlave(n)) {
+ addReplyError(c,"Target node is not a master");
+ return;
+ }
server.cluster->migrating_slots_to[slot] = n;
} else if (!strcasecmp(c->argv[3]->ptr,"importing") && c->argc == 5) {
if (server.cluster->slots[slot] == myself) {
@@ -4664,6 +4668,10 @@ NULL
(char*)c->argv[4]->ptr);
return;
}
+ if (nodeIsSlave(n)) {
+ addReplyError(c,"Target node is not a master");
+ return;
+ }
server.cluster->importing_slots_from[slot] = n;
} else if (!strcasecmp(c->argv[3]->ptr,"stable") && c->argc == 4) {
/* CLUSTER SETSLOT <SLOT> STABLE */
