mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
ACL: fix command ID assignment off by one error.
This commit is contained in:
parent
53ba09e08a
commit
eb840f9bc5
@ -511,6 +511,7 @@ unsigned long ACLGetCommandID(const char *cmdname) {
|
|||||||
raxInsert(map,(unsigned char*)lowername,strlen(lowername),
|
raxInsert(map,(unsigned char*)lowername,strlen(lowername),
|
||||||
(void*)nextid,NULL);
|
(void*)nextid,NULL);
|
||||||
sdsfree(lowername);
|
sdsfree(lowername);
|
||||||
|
unsigned long thisid = nextid;
|
||||||
nextid++;
|
nextid++;
|
||||||
|
|
||||||
/* We never assign the last bit in the user commands bitmap structure,
|
/* We never assign the last bit in the user commands bitmap structure,
|
||||||
@ -522,7 +523,7 @@ unsigned long ACLGetCommandID(const char *cmdname) {
|
|||||||
* default (loaded via modules). This is useful when rewriting the ACLs
|
* default (loaded via modules). This is useful when rewriting the ACLs
|
||||||
* with ACL SAVE. */
|
* with ACL SAVE. */
|
||||||
if (nextid == USER_COMMAND_BITS_COUNT-1) nextid++;
|
if (nextid == USER_COMMAND_BITS_COUNT-1) nextid++;
|
||||||
return nextid;
|
return thisid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return an username by its name, or NULL if the user does not exist. */
|
/* Return an username by its name, or NULL if the user does not exist. */
|
||||||
|
Loading…
Reference in New Issue
Block a user