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
010b24f8
Commit
010b24f8
authored
Jan 09, 2019
by
antirez
Browse files
ACL: set the command ID while populating the commands table.
parent
91f1d802
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
010b24f8
...
@@ -2202,6 +2202,8 @@ void populateCommandTable(void) {
...
@@ -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) {
...
@@ -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. */
...
...
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