Fix empty response for ACL CAT category subcommand for module defined categories (#1140)
The module commands which were added to acl categories were getting skipped when `ACL CAT category` command was executed. This PR fixes the bug. Before: ``` 127.0.0.1:6379> ACL CAT foocategory (empty array) ``` After: ``` 127.0.0.1:6379> ACL CAT foocategory aclcheck.module.command.test.add.new.aclcategories ``` --------- Signed-off-by: Roshan Khatri <rvkhatri@amazon.com> Co-authored-by: Harkrishn Patro <bunty.hari@gmail.com>
This commit is contained in:
parent
cd8de095c4
commit
9b8a06137c
@ -2760,7 +2760,6 @@ void aclCatWithFlags(client *c, dict *commands, uint64_t cflag, int *arraylen) {
|
||||
|
||||
while ((de = dictNext(di)) != NULL) {
|
||||
struct serverCommand *cmd = dictGetVal(de);
|
||||
if (cmd->flags & CMD_MODULE) continue;
|
||||
if (cmd->acl_categories & cflag) {
|
||||
addReplyBulkCBuffer(c, cmd->fullname, sdslen(cmd->fullname));
|
||||
(*arraylen)++;
|
||||
|
@ -143,6 +143,10 @@ start_server {tags {"modules acl"}} {
|
||||
assert_equal [r acl DRYRUN j8 aclcheck.module.command.test.add.new.aclcategories] OK
|
||||
}
|
||||
|
||||
test {test if ACL CAT output for the new category is correct} {
|
||||
assert_equal [r ACL CAT foocategory] aclcheck.module.command.test.add.new.aclcategories
|
||||
}
|
||||
|
||||
test {test permission compaction and simplification for categories added by a module} {
|
||||
r acl SETUSER j9 on >password -@all +@foocategory -@foocategory
|
||||
catch {r ACL GETUSER j9} res
|
||||
|
Loading…
x
Reference in New Issue
Block a user