From d4890c20c10d91e990b8af044a233d3e1da7bda0 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 8 Feb 2019 11:50:39 +0100 Subject: [PATCH] ACL: ignore modules commands when adding categories. We can't trust modules commands flagging, so module commands must be always explicitly added, with the exception of +@all that will include everything. However something like +@readonly should not include command from modules that may be potentially dangerous: our categories must be safe and reliable and modules may not be like that. --- src/acl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/acl.c b/src/acl.c index 4ae5830b..159a3507 100644 --- a/src/acl.c +++ b/src/acl.c @@ -313,6 +313,7 @@ int ACLSetUserCommandBitsForCategory(user *u, const char *category, int value) { dictEntry *de; while ((de = dictNext(di)) != NULL) { struct redisCommand *cmd = dictGetVal(de); + if (cmd->flags & CMD_MODULE) continue; /* Ignore modules commands. */ if (cmd->flags & cflag) { ACLSetUserCommandBit(u,cmd->id,value); ACLResetSubcommandsForCommand(u,cmd->id);