Skip to content

Commit

Permalink
fix(acl): remove none from acl categories (#3392)
Browse files Browse the repository at this point in the history
None does not exist in Valkey and its entry was missing from the indexes we use to map categories to commands leading to an out of bounds access and causing a segfault.

* remove none from acl categories

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
  • Loading branch information
kostasrim authored Jul 26, 2024
1 parent 0a26a06 commit 9d16bd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/server/acl/acl_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ class AclFamily final {
{"FT_SEARCH", FT_SEARCH},
{"THROTTLE", THROTTLE},
{"JSON", JSON},
{"ALL", ALL},
{"NONE", NONE}};
{"ALL", ALL}};

// bit 0 at index 0
// bit 1 at index 1
Expand Down
4 changes: 4 additions & 0 deletions src/server/acl/acl_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ TEST_F(AclFamilyTest, AclSetUser) {
vec = resp.GetVec();
EXPECT_THAT(vec,
UnorderedElementsAre("user default on nopass ~* +@all", "user vlad on -@all +acl"));

// +@NONE should not exist anymore. It's not in the spec.
resp = Run({"ACL", "SETUSER", "rand", "+@NONE"});
EXPECT_THAT(resp, ErrArg("ERR Unrecognized parameter +@NONE"));
}

TEST_F(AclFamilyTest, AclDelUser) {
Expand Down

0 comments on commit 9d16bd6

Please sign in to comment.