Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ed995ffa
Commit
ed995ffa
authored
May 23, 2021
by
Wen Hui
Committed by
Oran Agra
Jun 01, 2021
Browse files
[SENTINEL] reset sentinel-user/pass to NULL when user config with empty string (#8958)
(cherry picked from commit
ae6f5869
)
parent
875a1f07
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
ed995ffa
...
@@ -3175,11 +3175,13 @@ void sentinelConfigSetCommand(client *c) {
...
@@ -3175,11 +3175,13 @@ void sentinelConfigSetCommand(client *c) {
sentinel.announce_port = numval;
sentinel.announce_port = numval;
} else if (!strcasecmp(o->ptr, "sentinel-user")) {
} else if (!strcasecmp(o->ptr, "sentinel-user")) {
sdsfree(sentinel.sentinel_auth_user);
sdsfree(sentinel.sentinel_auth_user);
sentinel
.
sentinel_auth_user
=
sdsnew
(
val
->
ptr
);
sentinel.sentinel_auth_user = sdslen(val->ptr) == 0 ?
sdsdup(val->ptr) : NULL;
drop_conns = 1;
drop_conns = 1;
} else if (!strcasecmp(o->ptr, "sentinel-pass")) {
} else if (!strcasecmp(o->ptr, "sentinel-pass")) {
sdsfree(sentinel.sentinel_auth_pass);
sdsfree(sentinel.sentinel_auth_pass);
sentinel
.
sentinel_auth_pass
=
sdsnew
(
val
->
ptr
);
sentinel.sentinel_auth_pass = sdslen(val->ptr) == 0 ?
sdsdup(val->ptr) : NULL;
drop_conns = 1;
drop_conns = 1;
} else {
} else {
addReplyErrorFormat(c, "Invalid argument '%s' to SENTINEL CONFIG SET",
addReplyErrorFormat(c, "Invalid argument '%s' to SENTINEL CONFIG SET",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment