Commit f5d918b2 authored by antirez's avatar antirez
Browse files

ACL: HELLO should stop if the user is not authenticated.

parent b43d70df
...@@ -2053,6 +2053,15 @@ void helloCommand(client *c) { ...@@ -2053,6 +2053,15 @@ void helloCommand(client *c) {
return; return;
} }
/* At this point we need to be authenticated to continue. */
if (!c->authenticated) {
addReplyError(c,"-NOAUTH HELLO must be called with the client already "
"authenticated, otherwise the HELLO AUTH <user> <pass> "
"option can be used to authenticate the client and "
"select the RESP protocol version at the same time");
return;
}
/* Let's switch to RESP3 mode. */ /* Let's switch to RESP3 mode. */
c->resp = 3; c->resp = 3;
addReplyMapLen(c,7); addReplyMapLen(c,7);
......
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