summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-01-14 13:18:12 +0100
committerantirez <antirez@gmail.com>2019-01-14 13:18:12 +0100
commit67754ae021d5cb29dc9555a59847b652833a6e20 (patch)
tree3e6a1d6cffbf28a92950ac00f3b60826f638102b
parente7d15e4820f660e412974ae46b6b9ea61e59ace3 (diff)
downloadredis-67754ae021d5cb29dc9555a59847b652833a6e20.tar.gz
ACL: ACLSetUser(), fix flag and add allcommands +@all opcode.
-rw-r--r--src/acl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/acl.c b/src/acl.c
index 59540d2a1..fdc0744a5 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -153,8 +153,13 @@ int ACLSetUser(user *u, const char *op) {
} else if (!strcasecmp(op,"allkeys") ||
!strcasecmp(op,"~*"))
{
- memset(u->allowed_subcommands,255,sizeof(u->allowed_commands));
u->flags |= USER_FLAG_ALLKEYS;
+ if (u->patterns) listEmpty(u->patterns);
+ } else if (!strcasecmp(op,"allcommands") ||
+ !strcasecmp(op,"+@all"))
+ {
+ memset(u->allowed_subcommands,255,sizeof(u->allowed_commands));
+ u->flags |= USER_FLAG_ALLCOMMANDS;
} else {
return C_ERR;
}