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
ff92c069
Commit
ff92c069
authored
Jan 15, 2019
by
antirez
Browse files
ACL: fix command exec check by returning.
parent
c79b01f4
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
ff92c069
...
@@ -2596,6 +2596,14 @@ int processCommand(client *c) {
...
@@ -2596,6 +2596,14 @@ int processCommand(client *c) {
return
C_OK
;
return
C_OK
;
}
}
/* Check if the user can run this command according to the current
* ACLs. */
if
(
ACLCheckCommandPerm
(
c
)
==
C_ERR
)
{
flagTransaction
(
c
);
addReplyErrorFormat
(
c
,
"-NOPERM this user has no permissions to run the %s command"
,
c
->
cmd
->
name
);
return
C_OK
;
}
/* If cluster is enabled perform the cluster redirection here.
/* If cluster is enabled perform the cluster redirection here.
* However we don't perform the redirection if:
* However we don't perform the redirection if:
* 1) The sender of this command is our master.
* 1) The sender of this command is our master.
...
@@ -2688,12 +2696,6 @@ int processCommand(client *c) {
...
@@ -2688,12 +2696,6 @@ int processCommand(client *c) {
return
C_OK
;
return
C_OK
;
}
}
/* Check if the user can run this command according to the current
* ACLs. */
if
(
ACLCheckCommandPerm
(
c
)
==
C_ERR
)
{
addReplyErrorFormat
(
c
,
"-NOPERM this user has no permissions to run the %s command"
,
c
->
cmd
->
name
);
}
/* Only allow a subset of commands in the context of Pub/Sub if the
/* Only allow a subset of commands in the context of Pub/Sub if the
* connection is in RESP2 mode. With RESP3 there are no limits. */
* connection is in RESP2 mode. With RESP3 there are no limits. */
if
((
c
->
flags
&
CLIENT_PUBSUB
&&
c
->
resp
==
2
)
&&
if
((
c
->
flags
&
CLIENT_PUBSUB
&&
c
->
resp
==
2
)
&&
...
...
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