Skip to content

Fix: Loading ACL file was resetting requirepass config.#6835

Closed
oranagra wants to merge 1 commit intoredis:unstablefrom
oranagra:acl_reset_requirepass
Closed

Fix: Loading ACL file was resetting requirepass config.#6835
oranagra wants to merge 1 commit intoredis:unstablefrom
oranagra:acl_reset_requirepass

Conversation

@oranagra
Copy link
Member

@oranagra oranagra commented Feb 5, 2020

Unlike loading users from lines embedded in the config file.

Unlike loading users from lines embedded in the config file.
@oranagra
Copy link
Member Author

oranagra commented Feb 5, 2020

@antirez if i understand the code correctly, the purpose of creating the default user again in that code path was to re-create and re-register the user in the rax tree, but you did not intend to resets it's properties, right?
please see if my fix is correct.

@oranagra
Copy link
Member Author

oranagra commented Feb 6, 2020

i'm having second thoughts about keeping all the flags from old_default_user->flags, maybe i should have only kept USER_FLAG_NOPASS?

i.e. in case the previous ACL file disabled the default user, and the new ACL file doesn't do anything with the default user, i suppose it should have a default configuration (i.e. be enabled). and if i keep the flags i ruin that.

on the other hand, maybe you intended that as soon as someone uses an ACL file, he should avoid using requirepass, and set the default users's password in the acl file.. but it's odd that if the ACL rules don't touch the default user, it behaves differently if the ACL rules come from a file vs a case were the ACL rules are embedded in the config file. i.e. in one case they override requirepass and in the other case they dont.

@antirez
Copy link
Contributor

antirez commented Feb 6, 2020

Hi Oran, "requirepass" is only for compatibility with the past. If users mix the two, ACL LOAD should indeed remove the default user and load what is specified by the ACL file, without preserving anything I believe, so the old code looks reasonable to me.

@antirez
Copy link
Contributor

antirez commented Feb 6, 2020

In other terms, requirepass is a alias for ACL SETUSER default >"somepassword", or something like that.

@oranagra
Copy link
Member Author

oranagra commented Feb 6, 2020

ok. closing. thanks.

@oranagra oranagra closed this Feb 6, 2020
@oranagra oranagra deleted the acl_reset_requirepass branch February 6, 2020 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants