Unverified Commit 0cf2df84 authored by Madelyn Olson's avatar Madelyn Olson Committed by GitHub
Browse files

Added additional validation for cluster SETSLOT (#9360)

parent 2402f5a7
...@@ -4652,6 +4652,10 @@ NULL ...@@ -4652,6 +4652,10 @@ NULL
(char*)c->argv[4]->ptr); (char*)c->argv[4]->ptr);
return; return;
} }
if (nodeIsSlave(n)) {
addReplyError(c,"Target node is not a master");
return;
}
server.cluster->migrating_slots_to[slot] = n; server.cluster->migrating_slots_to[slot] = n;
} else if (!strcasecmp(c->argv[3]->ptr,"importing") && c->argc == 5) { } else if (!strcasecmp(c->argv[3]->ptr,"importing") && c->argc == 5) {
if (server.cluster->slots[slot] == myself) { if (server.cluster->slots[slot] == myself) {
...@@ -4664,6 +4668,10 @@ NULL ...@@ -4664,6 +4668,10 @@ NULL
(char*)c->argv[4]->ptr); (char*)c->argv[4]->ptr);
return; return;
} }
if (nodeIsSlave(n)) {
addReplyError(c,"Target node is not a master");
return;
}
server.cluster->importing_slots_from[slot] = n; server.cluster->importing_slots_from[slot] = n;
} else if (!strcasecmp(c->argv[3]->ptr,"stable") && c->argc == 4) { } else if (!strcasecmp(c->argv[3]->ptr,"stable") && c->argc == 4) {
/* CLUSTER SETSLOT <SLOT> STABLE */ /* CLUSTER SETSLOT <SLOT> STABLE */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment