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
d4d15315
Commit
d4d15315
authored
Feb 25, 2019
by
antirez
Browse files
RESP3: AUTH option for HELLO.
parent
57484397
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
d4d15315
...
@@ -2048,6 +2048,21 @@ void helloCommand(client *c) {
...
@@ -2048,6 +2048,21 @@ void helloCommand(client *c) {
return;
return;
}
}
for (int j = 2; j < c->argc; j++) {
int moreargs = (c->argc-1) - j;
const char *opt = c->argv[j]->ptr;
if (!strcasecmp(opt,"AUTH") && moreargs >= 2) {
if (ACLAuthenticateUser(c, c->argv[j+1], c->argv[j+2]) == C_ERR) {
addReplyError(c,"-WRONGPASS invalid username-password pair");
return;
}
j += 2;
} else {
addReplyErrorFormat(c,"Syntax error in HELLO option '%s'",opt);
return;
}
}
/* At this point we need to be authenticated to continue. */
/* At this point we need to be authenticated to continue. */
if (!c->authenticated) {
if (!c->authenticated) {
addReplyError(c,"-NOAUTH HELLO must be called with the client already "
addReplyError(c,"-NOAUTH HELLO must be called with the client already "
...
...
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