From 1769c222486d1deb33b394899eccab35be975c96 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 1 Feb 2019 11:37:20 +0100 Subject: [PATCH] ACL: set modules help clients to the root user. It does not make much sense to limit what modules can do: the admin should instead limit what module commnads an user may call. So RedisModule_Call() and other module operations should be able to execute everything they want: the limitation should be posed by the API exported by the module itself. --- src/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/module.c b/src/module.c index 9c24bfe2b..81982ba76 100644 --- a/src/module.c +++ b/src/module.c @@ -2697,6 +2697,7 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch /* Create the client and dispatch the command. */ va_start(ap, fmt); c = createClient(-1); + c->user = NULL; /* Root user. */ argv = moduleCreateArgvFromUserFormat(cmdname,fmt,&argc,&flags,ap); replicate = flags & REDISMODULE_ARGV_REPLICATE; va_end(ap); @@ -4660,6 +4661,7 @@ void moduleInitModulesSystem(void) { moduleKeyspaceSubscribers = listCreate(); moduleFreeContextReusedClient = createClient(-1); moduleFreeContextReusedClient->flags |= CLIENT_MODULE; + moduleFreeContextReusedClient->user = NULL; /* root user. */ moduleRegisterCoreAPI(); if (pipe(server.module_blocked_pipe) == -1) {