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
4db92e59
Commit
4db92e59
authored
Jan 29, 2019
by
antirez
Browse files
ACL: ACLDescribeUserCommandRules(): add final commands.
parent
11f64c68
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
4db92e59
...
@@ -303,8 +303,22 @@ sds ACLDescribeUserCommandRules(user *u) {
...
@@ -303,8 +303,22 @@ sds ACLDescribeUserCommandRules(user *u) {
}
}
/* Fix the final ACLs with single commands differences. */
/* Fix the final ACLs with single commands differences. */
dictIterator
*
di
=
dictGetIterator
(
server
.
orig_commands
);
dictEntry
*
de
;
while
((
de
=
dictNext
(
di
))
!=
NULL
)
{
struct
redisCommand
*
cmd
=
dictGetVal
(
de
);
int
userbit
=
ACLGetUserCommandBit
(
u
,
cmd
->
id
);
int
fakebit
=
ACLGetUserCommandBit
(
u
,
cmd
->
id
);
if
(
userbit
!=
fakebit
)
{
rules
=
sdscatlen
(
rules
,
userbit
?
"+"
:
"-"
,
1
);
rules
=
sdscat
(
rules
,
cmd
->
name
);
rules
=
sdscatlen
(
rules
,
" "
,
1
);
}
}
dictReleaseIterator
(
di
);
/* Trim the final useless space. */
/* Trim the final useless space. */
sdsrange
(
rules
,
0
,
-
2
);
/* This is technically not needed, but we want to verify that now the
/* This is technically not needed, but we want to verify that now the
* predicted bitmap is exactly the same as the user bitmap, and abort
* predicted bitmap is exactly the same as the user bitmap, and abort
...
...
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