summaryrefslogtreecommitdiff
path: root/src/acl.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-01-13 02:05:14 +0800
committerGitHub <noreply@github.com>2022-01-12 20:05:14 +0200
commit20c33fe6a8fce2edb3e4158bc10bde2c3740a25b (patch)
tree11e248b2def3ed945381e4944ba5bccd5257ed36 /src/acl.c
parente22146b07a8b5adc37e0153def1783406eb6d27c (diff)
downloadredis-20c33fe6a8fce2edb3e4158bc10bde2c3740a25b.tar.gz
Show subcommand full name in error log / ACL LOG (#10105)
Use `getFullCommandName` to get the full name of the command. It can also get the full name of the subcommand, like "script|help". Before: ``` > SCRIPT HELP (error) NOPERM this user has no permissions to run the 'help' command or its subcommand > ACL LOG 7) "object" 8) "help" ``` After: ``` > SCRIPT HELP (error) NOPERM this user has no permissions to run the 'script|help' command > ACL LOG 7) "object" 8) "script|help" ``` Fix #10094
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/acl.c b/src/acl.c
index 19b357c9e..aff48afd4 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1904,7 +1904,7 @@ void addACLLogEntry(client *c, int reason, int context, int argpos, sds username
le->object = object;
} else {
switch(reason) {
- case ACL_DENIED_CMD: le->object = sdsnew(c->cmd->name); break;
+ case ACL_DENIED_CMD: le->object = getFullCommandName(c->cmd); break;
case ACL_DENIED_KEY: le->object = sdsdup(c->argv[argpos]->ptr); break;
case ACL_DENIED_CHANNEL: le->object = sdsdup(c->argv[argpos]->ptr); break;
case ACL_DENIED_AUTH: le->object = sdsdup(c->argv[0]->ptr); break;