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
f4d37173
Commit
f4d37173
authored
Sep 11, 2019
by
antirez
Browse files
ACL: protect MULTI/EXEC transactions after rules change.
parent
ae8cab32
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/multi.c
View file @
f4d37173
...
...
@@ -175,7 +175,19 @@ void execCommand(client *c) {
must_propagate
=
1
;
}
call
(
c
,
server
.
loading
?
CMD_CALL_NONE
:
CMD_CALL_FULL
);
int
acl_retval
=
ACLCheckCommandPerm
(
c
);
if
(
acl_retval
!=
ACL_OK
)
{
addReplyErrorFormat
(
c
,
"-NOPERM ACLs rules changed between the moment the "
"transaction was accumulated and the EXEC call. "
"This command is no longer allowed for the "
"following reason: %s"
,
(
acl_retval
==
ACL_DENIED_CMD
)
?
"no permission to execute the command or subcommand"
:
"no permission to touch the specified keys"
);
}
else
{
call
(
c
,
server
.
loading
?
CMD_CALL_NONE
:
CMD_CALL_FULL
);
}
/* Commands may alter argc/argv, restore mstate. */
c
->
mstate
.
commands
[
j
].
argc
=
c
->
argc
;
...
...
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