diff options
author | Binbin <binloveplay1314@qq.com> | 2022-01-13 02:05:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 20:05:14 +0200 |
commit | 20c33fe6a8fce2edb3e4158bc10bde2c3740a25b (patch) | |
tree | 11e248b2def3ed945381e4944ba5bccd5257ed36 /src/acl.c | |
parent | e22146b07a8b5adc37e0153def1783406eb6d27c (diff) | |
download | redis-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |