summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-01-15 17:57:49 +0100
committerantirez <antirez@gmail.com>2019-01-15 17:57:49 +0100
commit35fe59935ef809956f593cd4973387665d2d072f (patch)
tree74eceae72add4b8ed60751bc276c7df603dffe2b
parent52e99229874d92507cb768a665ed16185c4fbffa (diff)
downloadredis-35fe59935ef809956f593cd4973387665d2d072f.tar.gz
ACL: automatically authenticate the nopass default user.
-rw-r--r--src/networking.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/networking.c b/src/networking.c
index 754f222dd..4aa193142 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -125,7 +125,9 @@ client *createClient(int fd) {
c->sentlen = 0;
c->flags = 0;
c->ctime = c->lastinteraction = server.unixtime;
- c->authenticated = 0;
+ /* If the default user does not require authentication, the user is
+ * directly authenticated. */
+ c->authenticated = (c->user->flags & USER_FLAG_NOPASS) != 0;
c->replstate = REPL_STATE_NONE;
c->repl_put_online_on_ack = 0;
c->reploff = 0;