dragonflydb / dragonflydb/dragonfly

Accept "user <name> on|off" ACL rule

Open Beginner friendly
#8,299 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
31.6k
Forks
1.3k
Avg merge
1d 10h
Merged PRs (30d)
137

Description

**Describe the bug**
Dragonfly's ACL file parser rejects lines with fewer than 4 whitespace-separated tokens, including minimal lines like `user default off` that Redis and Valkey accept.

**To Reproduce**
Create an ACL file containing:

```
user default off
```

Start Dragonfly with --aclfile=/path/to/file or run ACL LOAD.

**Expected behavior**
Matching Redis/Valkey, the file loads successfully, creating/updating the default user with no additional category/key/pubsub changes beyond.

**Actual behavior**
```
ERR Error loading: /path/users.acl Error materializing acl file
```

**Root cause**
In acl_family.cc, MaterializeFileContents requires at least 4 tokens per line:

```
std::vector cmds = absl::StrSplit(command, ' ', absl::SkipEmpty());
if (!absl::EqualsIgnoreCase(cmds[0], "USER") || cmds.size() < 4) {
return {};
}
```

user default off produces only 3 tokens (USER, default, off), so it's rejected outright.

Contributor guide

Open the contributing guide

Research direction

Start in acl_family.cc at MaterializeFileContents and inspect how ACL file lines are tokenized and validated. Reproduce with an ACL file containing `user default off` using --aclfile or ACL LOAD, then verify that the minimal rule loads successfully without unintended category, key, or pubsub changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
authorization, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.