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
5b52bc73
Commit
5b52bc73
authored
Mar 09, 2019
by
John Sully
Browse files
Replicas aren't allowed to run the replicaof command
parent
0f03312c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/replication.c
View file @
5b52bc73
...
...
@@ -2038,6 +2038,14 @@ void replicaofCommand(client *c) {
}
else
{
long
port
;
if
(
c
->
flags
&
CLIENT_SLAVE
)
{
/* If a client is already a replica they cannot run this command,
* because it involves flushing all replicas (including this client) */
addReplyError
(
c
,
"Command is not valid when client is a replica."
);
return
;
}
if
((
getLongFromObjectOrReply
(
c
,
c
->
argv
[
2
],
&
port
,
NULL
)
!=
C_OK
))
return
;
...
...
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