Skip to content

Handle binary safe string for REQUIREPASS and MASTERAUTH directives#8200

Merged
madolson merged 2 commits intoredis:unstablefrom
QuChen88:fix-masterauth
Dec 17, 2020
Merged

Handle binary safe string for REQUIREPASS and MASTERAUTH directives#8200
madolson merged 2 commits intoredis:unstablefrom
QuChen88:fix-masterauth

Conversation

@QuChen88
Copy link
Contributor

Previously neither server.requirepass or server.masterauth handles binary safe SDS strings. This leads to inconsistencies in client experience around password authentication. This CR makes REQUIREPASS and MASTERAUTH directives handle binary safe strings and added generic SDS argument support in config.c.

i.e. On master

config set requirepass "ab\x00cd"
OK
AUTH ab
OK
AUTH "ab\x00cd"
(error) WRONGPASS invalid username-password pair

After the fix.

config set requirepass "ab\x00cd"
OK
AUTH ab
(error) WRONGPASS invalid username-password pair
AUTH "ab\x00cd"
OK

Same goes for MASTERAUTH.

See original related PR #7236

Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuChen88 thank you for this PR.
All the changes seem good to me, except for small improvement request in the test.

p.s. i actually have a big refactoring to sendSynchronousCommand stashed somewhere, which can come instead of the modification you made there, i'll try to push it in after this PR is merged.

@oranagra oranagra added the state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten label Dec 16, 2020
@QuChen88
Copy link
Contributor Author

@oranagra Thanks. I can look into the TCL test. Do you have an example of the "wait_for" mechanism on a log message in another TCL test?

@oranagra
Copy link
Member

@QuChen88 Just grep for wait_for_log_messages (I'm AFK)

Copy link
Contributor

@JimB123 JimB123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits. No showstoppers.

@QuChen88
Copy link
Contributor Author

PR is updated with all comments resolved

@madolson madolson merged commit f48afb4 into redis:unstable Dec 17, 2020
@QuChen88 QuChen88 deleted the fix-masterauth branch December 19, 2020 08:26
@QuChen88 QuChen88 restored the fix-masterauth branch December 19, 2020 08:38
linxiang-dev pushed a commit to linxiang-dev/redis that referenced this pull request Dec 27, 2020
…edis#8200)

* Handle binary safe string for REQUIREPASS and MASTERAUTH directives.
@oranagra oranagra added the release-notes indication that this issue needs to be mentioned in the release notes label Jan 10, 2021
@oranagra oranagra mentioned this pull request Jan 10, 2021
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Mar 2, 2021
…edis#8200)

* Handle binary safe string for REQUIREPASS and MASTERAUTH directives.
@QuChen88 QuChen88 deleted the fix-masterauth branch March 3, 2021 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants