Commit 889eaba2 authored by antirez's avatar antirez
Browse files

ACL: deny commands execution of disabled users.

parent c2db3de4
...@@ -1055,6 +1055,10 @@ int ACLCheckCommandPerm(client *c, int *keyidxptr) { ...@@ -1055,6 +1055,10 @@ int ACLCheckCommandPerm(client *c, int *keyidxptr) {
/* If there is no associated user, the connection can run anything. */ /* If there is no associated user, the connection can run anything. */
if (u == NULL) return ACL_OK; 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. */ /* Check if the user can execute this command. */
if (!(u->flags & USER_FLAG_ALLCOMMANDS) && if (!(u->flags & USER_FLAG_ALLCOMMANDS) &&
c->cmd->proc != authCommand) c->cmd->proc != authCommand)
......
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