Unverified Commit ae6f5869 authored by Wen Hui's avatar Wen Hui Committed by GitHub
Browse files

[SENTINEL] reset sentinel-user/pass to NULL when user config with empty string (#8958)

parent a319327f
......@@ -3161,11 +3161,13 @@ void sentinelConfigSetCommand(client *c) {
sentinel.announce_port = numval;
} else if (!strcasecmp(o->ptr, "sentinel-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;
} else if (!strcasecmp(o->ptr, "sentinel-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;
} else {
addReplyErrorFormat(c, "Invalid argument '%s' to SENTINEL CONFIG SET",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment