mirror of https://mirror.osredm.com/root/redis.git
[SENTINEL] reset sentinel-user/pass to NULL when user config with empty string (#8958)
This commit is contained in:
parent
a319327ffb
commit
ae6f58690b
|
@ -3161,11 +3161,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",
|
||||||
|
|
Loading…
Reference in New Issue