From 010b24f864134bc8f52228e6bbf6f8c52cecd5b6 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 9 Jan 2019 17:23:23 +0100 Subject: [PATCH] ACL: set the command ID while populating the commands table. --- src/server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server.c b/src/server.c index 5c15d223b..df9488873 100644 --- a/src/server.c +++ b/src/server.c @@ -2202,6 +2202,8 @@ void populateCommandTable(void) { char *f = c->sflags; int retval1, retval2; + /* Translate the command string flags description into an actual + * set of flags. */ while(*f != '\0') { switch(*f) { case 'w': c->flags |= CMD_WRITE; break; @@ -2222,6 +2224,8 @@ void populateCommandTable(void) { f++; } + c->id = j; /* Sequential ID for each command. Used for ACLs. */ + retval1 = dictAdd(server.commands, sdsnew(c->name), c); /* Populate an additional dictionary that will be unaffected * by rename-command statements in redis.conf. */