Skip to content

Handle binary safe string for REQUIREPASS and MASTERAUTH directives#7236

Closed
QuChen88 wants to merge 2 commits intoredis:unstablefrom
QuChen88:masterauth
Closed

Handle binary safe string for REQUIREPASS and MASTERAUTH directives#7236
QuChen88 wants to merge 2 commits intoredis:unstablefrom
QuChen88:masterauth

Conversation

@QuChen88
Copy link
Contributor

Make REQUIREPASS and MASTERAUTH directives handle binary safe strings. Previously neither server.requirepass or server.masterauth handles binary safe SDS strings. This leads to inconsistencies in client experience around password authentication.

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.

@antirez
Copy link
Contributor

antirez commented May 18, 2020

Hello @QuChen88, the idea makes sense, but on the other hand, it is odd that we don't have handling for config directives that are strings in the SDS form: we have plenty of them. So because this fix is non critical, I'm not sure it makes any sense to add more custom code for new options instead of fixing the problem that we don't handle SDS string options. Pinging @madolson for her POV as well.

@QuChen88
Copy link
Contributor Author

@antirez Yes I think the suggestion makes sense. I can take a look into supporting binary SDS string options in a more general way here.

@madolson madolson self-requested a review July 21, 2020 03:23
@madolson
Copy link
Contributor

Oh look, no more antirez :D. I still think his original suggestion made sense. I think we should extend the createStringconfig() to support createSDSConfig(). It's a different type, so I think it should have a different variable. I would look at the way numerics are handled for an example.

@antirez
Copy link
Contributor

antirez commented Sep 17, 2020

Oh look, no more antirez :D. I still think his original suggestion made sense. I think we should extend the createStringconfig() to support createSDSConfig(). It's a different type, so I think it should have a different variable. I would look at the way numerics are handled for an example.

My soul keep watching on you.

@madolson
Copy link
Contributor

There is a segfault in the test run, can you take a look at that?

@QuChen88
Copy link
Contributor Author

I was not able to reproduce the test failure / crash locally on my Mac. All the tests passed.

@QuChen88
Copy link
Contributor Author

QuChen88 commented Sep 29, 2020

I ran make test on a Ubuntu instance launched in EC2, I was able to reproduce this error after I rebased on the latest redis:unstable. Taking a look.

@QuChen88
Copy link
Contributor Author

This CR is getting too outdated and have merge-conflicts and test failures. I created another branch and opened a more updated PR. Closing this one in favor of #8200

@QuChen88 QuChen88 closed this Dec 16, 2020
@QuChen88 QuChen88 deleted the masterauth branch December 16, 2020 07:29
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.

3 participants