From ca53975a6ba794170b9c88568618b2da38636857 Mon Sep 17 00:00:00 2001 From: Roshan Khatri Date: Wed, 9 Oct 2024 19:58:20 +0000 Subject: [PATCH] fixes acl cat bug Signed-off-by: Roshan Khatri --- src/acl.c | 1 - tests/unit/moduleapi/aclcheck.tcl | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/acl.c b/src/acl.c index 14d9c6e6f3..688820fd89 100644 --- a/src/acl.c +++ b/src/acl.c @@ -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)++; diff --git a/tests/unit/moduleapi/aclcheck.tcl b/tests/unit/moduleapi/aclcheck.tcl index 1ea09a2324..5e8d1360d8 100644 --- a/tests/unit/moduleapi/aclcheck.tcl +++ b/tests/unit/moduleapi/aclcheck.tcl @@ -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