Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
eb840f9b
Commit
eb840f9b
authored
Jan 25, 2019
by
antirez
Browse files
ACL: fix command ID assignment off by one error.
parent
53ba09e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
eb840f9b
...
...
@@ -511,6 +511,7 @@ unsigned long ACLGetCommandID(const char *cmdname) {
raxInsert
(
map
,(
unsigned
char
*
)
lowername
,
strlen
(
lowername
),
(
void
*
)
nextid
,
NULL
);
sdsfree
(
lowername
);
unsigned
long
thisid
=
nextid
;
nextid
++
;
/* 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
* with ACL SAVE. */
if
(
nextid
==
USER_COMMAND_BITS_COUNT
-
1
)
nextid
++
;
return
next
id
;
return
this
id
;
}
/* Return an username by its name, or NULL if the user does not exist. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment