Skip to content

Commit

Permalink
fixes acl cat bug
Browse files Browse the repository at this point in the history
Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
  • Loading branch information
roshkhatri committed Oct 9, 2024
1 parent cd8de09 commit ca53975
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)++;
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/moduleapi/aclcheck.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ 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} {
set cmds_in_cat [r ACL CAT foocategory]
assert {$cmds_in_cat eq {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
Expand Down

0 comments on commit ca53975

Please sign in to comment.