-
Notifications
You must be signed in to change notification settings - Fork 24.4k
[SENTINEL] reset sentinel-user/pass to NULL when user config with empty string #8958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SENTINEL] reset sentinel-user/pass to NULL when user config with empty string #8958
Conversation
src/sentinel.c
Outdated
| sentinel.sentinel_auth_user = strcmp(val->ptr,"") ? | ||
| sdsnew(val->ptr) : NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about using sdslen() == 0 instead of strcmp? and also maybe sdsdup instead of sdsnew?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @oranagra for your suggestion, updated
|
@hwware looks like sentinel tests are consistently failing now. |
|
hi @oranagra , i will provide a quick fix shortly, thank you! |
fix for recent breakage from #8958, did a mistake when updating the pr.
fix for recent breakage from redis#8958, did a mistake when updating the pr.
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.