diff options
author | antirez <antirez@gmail.com> | 2018-12-21 17:24:14 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-12-21 17:24:14 +0100 |
commit | e10faefd4885dae715e7f2d9c3214cd8b5f847ab (patch) | |
tree | b07a5dc594a490c68a0e3b133154570697664f48 | |
parent | d2cecfdf8ac75db71a80756adceae0553e981b6e (diff) | |
download | redis-resp3.tar.gz |
ACL: HELLO should stop if the user is not authenticated.resp3
-rw-r--r-- | src/networking.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c index 0a32f3113..5657a7643 100644 --- a/src/networking.c +++ b/src/networking.c @@ -2053,6 +2053,15 @@ void helloCommand(client *c) { 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. */ c->resp = 3; addReplyMapLen(c,7); |