mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
ACL: set the command ID while populating the commands table.
This commit is contained in:
parent
91f1d8026b
commit
010b24f864
@ -2202,6 +2202,8 @@ void populateCommandTable(void) {
|
|||||||
char *f = c->sflags;
|
char *f = c->sflags;
|
||||||
int retval1, retval2;
|
int retval1, retval2;
|
||||||
|
|
||||||
|
/* Translate the command string flags description into an actual
|
||||||
|
* set of flags. */
|
||||||
while(*f != '\0') {
|
while(*f != '\0') {
|
||||||
switch(*f) {
|
switch(*f) {
|
||||||
case 'w': c->flags |= CMD_WRITE; break;
|
case 'w': c->flags |= CMD_WRITE; break;
|
||||||
@ -2222,6 +2224,8 @@ void populateCommandTable(void) {
|
|||||||
f++;
|
f++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c->id = j; /* Sequential ID for each command. Used for ACLs. */
|
||||||
|
|
||||||
retval1 = dictAdd(server.commands, sdsnew(c->name), c);
|
retval1 = dictAdd(server.commands, sdsnew(c->name), c);
|
||||||
/* Populate an additional dictionary that will be unaffected
|
/* Populate an additional dictionary that will be unaffected
|
||||||
* by rename-command statements in redis.conf. */
|
* by rename-command statements in redis.conf. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user