From 648411eb7dcd5a16cfbd146823cff8aeeb269369 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 14 Jan 2019 13:20:45 +0100 Subject: [PATCH] ACL: Add hook in processCommand() to check the ACLs before call(). --- src/server.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server.c b/src/server.c index a63b7522..49f62f37 100644 --- a/src/server.c +++ b/src/server.c @@ -2687,6 +2687,12 @@ int processCommand(client *c) { return C_OK; } + /* Check if the user can run this command according to the current + * ACLs. */ + if (ACLCheckCommandPerm(c) == C_ERR) { + addReplyErrorFormat(c,"-NOPERM this user has no permissions to run the %s command", cmd->name); + } + /* Only allow a subset of commands in the context of Pub/Sub if the * connection is in RESP2 mode. With RESP3 there are no limits. */ if ((c->flags & CLIENT_PUBSUB && c->resp == 2) &&