From bc168c91ecdbfd32b1d77687460f6b730f9584d0 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 30 Jan 2020 10:50:32 +0100 Subject: [PATCH] ACL LOG: also log ACL errors in the scripting/MULTI ctx. --- src/multi.c | 4 +++- src/scripting.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/multi.c b/src/multi.c index 640149870..a88e5336b 100644 --- a/src/multi.c +++ b/src/multi.c @@ -177,8 +177,10 @@ void execCommand(client *c) { must_propagate = 1; } - int acl_retval = ACLCheckCommandPerm(c,NULL); + int acl_keypos; + int acl_retval = ACLCheckCommandPerm(c,&acl_keypos); if (acl_retval != ACL_OK) { + addACLLogEntry(c,acl_retval,acl_keypos); addReplyErrorFormat(c, "-NOPERM ACLs rules changed between the moment the " "transaction was accumulated and the EXEC call. " diff --git a/src/scripting.c b/src/scripting.c index 0e47ebcb0..916b90cf1 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -606,8 +606,10 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) { } /* Check the ACLs. */ - int acl_retval = ACLCheckCommandPerm(c,NULL); + int acl_keypos; + int acl_retval = ACLCheckCommandPerm(c,&acl_keypos); if (acl_retval != ACL_OK) { + addACLLogEntry(c,acl_retval,acl_keypos); if (acl_retval == ACL_DENIED_CMD) luaPushError(lua, "The user executing the script can't run this " "command or subcommand");