From 67754ae021d5cb29dc9555a59847b652833a6e20 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 14 Jan 2019 13:18:12 +0100 Subject: [PATCH] ACL: ACLSetUser(), fix flag and add allcommands +@all opcode. --- src/acl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }