mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
ACL: ACLDescribeUserCommandRules(): add final commands.
This commit is contained in:
parent
11f64c6886
commit
4db92e5928
14
src/acl.c
14
src/acl.c
@ -303,8 +303,22 @@ sds ACLDescribeUserCommandRules(user *u) {
|
||||
}
|
||||
|
||||
/* Fix the final ACLs with single commands differences. */
|
||||
dictIterator *di = dictGetIterator(server.orig_commands);
|
||||
dictEntry *de;
|
||||
while ((de = dictNext(di)) != NULL) {
|
||||
struct redisCommand *cmd = dictGetVal(de);
|
||||
int userbit = ACLGetUserCommandBit(u,cmd->id);
|
||||
int fakebit = ACLGetUserCommandBit(u,cmd->id);
|
||||
if (userbit != fakebit) {
|
||||
rules = sdscatlen(rules, userbit ? "+" : "-", 1);
|
||||
rules = sdscat(rules,cmd->name);
|
||||
rules = sdscatlen(rules," ",1);
|
||||
}
|
||||
}
|
||||
dictReleaseIterator(di);
|
||||
|
||||
/* Trim the final useless space. */
|
||||
sdsrange(rules,0,-2);
|
||||
|
||||
/* This is technically not needed, but we want to verify that now the
|
||||
* predicted bitmap is exactly the same as the user bitmap, and abort
|
||||
|
Loading…
Reference in New Issue
Block a user