summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-01-30 10:50:32 +0100
committerantirez <antirez@gmail.com>2020-01-30 10:50:32 +0100
commit396161765b4f44f84fe428576a4272003669cec9 (patch)
treeaa665bfaa42e61905d4657ad9bcc6d9d2a4f479f /src
parent30a466ba38759e8deb5ed79c18bb3d3dec352ad7 (diff)
downloadredis-396161765b4f44f84fe428576a4272003669cec9.tar.gz
ACL LOG: also log ACL errors in the scripting/MULTI ctx.
Diffstat (limited to 'src')
-rw-r--r--src/multi.c4
-rw-r--r--src/scripting.c4
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");