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
9ae8e3fe
Commit
9ae8e3fe
authored
Jan 30, 2019
by
antirez
Browse files
ACL: clear the subcommands array when setting category bits.
parent
feba39d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
9ae8e3fe
...
@@ -67,6 +67,8 @@ struct ACLCategoryItem {
...
@@ -67,6 +67,8 @@ struct ACLCategoryItem {
{
""
,
0
}
/* Terminator. */
{
""
,
0
}
/* Terminator. */
};
};
void
ACLResetSubcommandsForCommand
(
user
*
u
,
unsigned
long
id
);
/* =============================================================================
/* =============================================================================
* Helper functions for the rest of the ACL implementation
* Helper functions for the rest of the ACL implementation
* ==========================================================================*/
* ==========================================================================*/
...
@@ -222,7 +224,10 @@ int ACLSetUserCommandBitsForCategory(user *u, const char *category, int value) {
...
@@ -222,7 +224,10 @@ int ACLSetUserCommandBitsForCategory(user *u, const char *category, int value) {
dictEntry
*
de
;
dictEntry
*
de
;
while
((
de
=
dictNext
(
di
))
!=
NULL
)
{
while
((
de
=
dictNext
(
di
))
!=
NULL
)
{
struct
redisCommand
*
cmd
=
dictGetVal
(
de
);
struct
redisCommand
*
cmd
=
dictGetVal
(
de
);
if
(
cmd
->
flags
&
cflag
)
ACLSetUserCommandBit
(
u
,
cmd
->
id
,
value
);
if
(
cmd
->
flags
&
cflag
)
{
ACLSetUserCommandBit
(
u
,
cmd
->
id
,
value
);
ACLResetSubcommandsForCommand
(
u
,
cmd
->
id
);
}
}
}
dictReleaseIterator
(
di
);
dictReleaseIterator
(
di
);
return
C_OK
;
return
C_OK
;
...
...
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