summaryrefslogtreecommitdiff
path: root/src/acl.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-04-22 17:14:15 +0200
committerantirez <antirez@gmail.com>2020-04-22 17:14:15 +0200
commit889eaba2b70d7652accd6d34c305023eea490fbc (patch)
treee71e8bbb8d4b520794ef0abd9dcef626c87b151d /src/acl.c
parentc2db3de49859a43a0685885f4f73d7ee0000728e (diff)
downloadredis-889eaba2b70d7652accd6d34c305023eea490fbc.tar.gz
ACL: deny commands execution of disabled users.
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/acl.c b/src/acl.c
index 75b954c5e..9e2ed6af7 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1055,6 +1055,10 @@ int ACLCheckCommandPerm(client *c, int *keyidxptr) {
/* If there is no associated user, the connection can run anything. */
if (u == NULL) return ACL_OK;
+ /* If the user is disabled we don't allow the execution of any
+ * command. */
+ if (!(u->flags & USER_FLAG_ENABLED)) return ACL_DENIED_CMD;
+
/* Check if the user can execute this command. */
if (!(u->flags & USER_FLAG_ALLCOMMANDS) &&
c->cmd->proc != authCommand)