summaryrefslogtreecommitdiff
path: root/src/networking.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-12-21 17:24:14 +0100
committerantirez <antirez@gmail.com>2019-01-09 17:00:30 +0100
commitf5d918b2bb1bae3c84dee635ac13526779e9294c (patch)
treec155411db944f76526317673735d6959ea87a83a /src/networking.c
parentb43d70df568d85ba0fb79c9e0129d4654ef471ee (diff)
downloadredis-f5d918b2bb1bae3c84dee635ac13526779e9294c.tar.gz
ACL: HELLO should stop if the user is not authenticated.
Diffstat (limited to 'src/networking.c')
-rw-r--r--src/networking.c9
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);