From 3ec2dc3a6d5763adb8cf319327b960814049b83b Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 31 Jan 2019 17:04:42 +0100 Subject: [PATCH] ACL: don't emit useless flags in ACLDescribeUser(). --- src/acl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/acl.c b/src/acl.c index 74efbcc33..cf46ef812 100644 --- a/src/acl.c +++ b/src/acl.c @@ -383,6 +383,10 @@ sds ACLDescribeUser(user *u) { /* Flags. */ for (int j = 0; ACLUserFlags[j].flag; j++) { + /* Skip the allcommands and allkeys flags because they'll be emitted + * later as ~* and +@all. */ + if (ACLUserFlags[j].flag == USER_FLAG_ALLKEYS || + ACLUserFlags[j].flag == USER_FLAG_ALLCOMMANDS) continue; if (u->flags & ACLUserFlags[j].flag) { res = sdscat(res,ACLUserFlags[j].name); res = sdscatlen(res," ",1);