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
f9c56dbb
Commit
f9c56dbb
authored
Mar 20, 2020
by
antirez
Browse files
ACL: default user off should not allow automatic authentication.
This fixes issue #7011.
parent
b3a97004
Changes
2
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
f9c56dbb
...
@@ -124,7 +124,8 @@ client *createClient(connection *conn) {
...
@@ -124,7 +124,8 @@ client *createClient(connection *conn) {
c->ctime = c->lastinteraction = server.unixtime;
c->ctime = c->lastinteraction = server.unixtime;
/* If the default user does not require authentication, the user is
/* If the default user does not require authentication, the user is
* directly authenticated. */
* directly authenticated. */
c
->
authenticated
=
(
c
->
user
->
flags
&
USER_FLAG_NOPASS
)
!=
0
;
c->authenticated = (c->user->flags & USER_FLAG_NOPASS) &&
!(c->user->flags & USER_FLAG_DISABLED);
c->replstate = REPL_STATE_NONE;
c->replstate = REPL_STATE_NONE;
c->repl_put_online_on_ack = 0;
c->repl_put_online_on_ack = 0;
c->reploff = 0;
c->reploff = 0;
...
...
src/server.c
View file @
f9c56dbb
...
@@ -3380,7 +3380,7 @@ int processCommand(client *c) {
...
@@ -3380,7 +3380,7 @@ int processCommand(client *c) {
/* Check if the user is authenticated. This check is skipped in case
/* Check if the user is authenticated. This check is skipped in case
* the default user is flagged as "nopass" and is active. */
* the default user is flagged as "nopass" and is active. */
int auth_required = (!(DefaultUser->flags & USER_FLAG_NOPASS) ||
int auth_required = (!(DefaultUser->flags & USER_FLAG_NOPASS) ||
DefaultUser->flags & USER_FLAG_DISABLED) &&
(
DefaultUser->flags & USER_FLAG_DISABLED)
)
&&
!c->authenticated;
!c->authenticated;
if (auth_required) {
if (auth_required) {
/* AUTH and HELLO and no auth modules are valid even in
/* AUTH and HELLO and no auth modules are valid even in
...
...
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