[SENTINEL] reset sentinel-user/pass to NULL when user config with empty string#8958
Merged
oranagra merged 2 commits intoredis:unstablefrom May 23, 2021
Merged
Conversation
oranagra
reviewed
May 18, 2021
src/sentinel.c
Outdated
Comment on lines
3164
to
3165
| sentinel.sentinel_auth_user = strcmp(val->ptr,"") ? | ||
| sdsnew(val->ptr) : NULL; |
Member
There was a problem hiding this comment.
how about using sdslen() == 0 instead of strcmp? and also maybe sdsdup instead of sdsnew?
Contributor
Author
There was a problem hiding this comment.
thanks @oranagra for your suggestion, updated
oranagra
approved these changes
May 23, 2021
Member
|
@hwware looks like sentinel tests are consistently failing now. |
Contributor
Author
|
hi @oranagra , i will provide a quick fix shortly, thank you! |
oranagra
pushed a commit
that referenced
this pull request
May 24, 2021
fix for recent breakage from #8958, did a mistake when updating the pr.
oranagra
pushed a commit
that referenced
this pull request
Jun 1, 2021
Merged
JackieXie168
pushed a commit
to JackieXie168/redis
that referenced
this pull request
Sep 8, 2021
JackieXie168
pushed a commit
to JackieXie168/redis
that referenced
this pull request
Sep 8, 2021
fix for recent breakage from redis#8958, did a mistake when updating the pr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this commit, when user set sentinel-user/pass to empty string using SENTINEL CONFIG SET command, sentinel will consider "" as a vaild sernanme/password and dump into config file, therefore, the following error happens when start server again using same config file:
In this commit, when user calling set sentinel-user/pass and pass into an empty string, we set sentinel.sentinel_auth_user/pass to NULL to avoid the above rewite issue.