ACL: fix ##6408, default user state affecting all the connections.

This commit is contained in:
antirez 2019-09-25 17:45:05 +02:00
parent eda703ab28
commit 8a531cedb0

View File

@ -3341,9 +3341,10 @@ 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) &&
!c->authenticated; !c->authenticated;
if (auth_required || DefaultUser->flags & USER_FLAG_DISABLED) { if (auth_required) {
/* AUTH and HELLO are valid even in non authenticated state. */ /* AUTH and HELLO are valid even in non authenticated state. */
if (c->cmd->proc != authCommand || c->cmd->proc == helloCommand) { if (c->cmd->proc != authCommand || c->cmd->proc == helloCommand) {
flagTransaction(c); flagTransaction(c);