Fix failure to respect masterauth issue #26

Former-commit-id: a69b4e79db46f629da94c4a1172ea9b1c68dff35
This commit is contained in:
John Sully 2019-04-11 19:08:12 -04:00
parent 9e714b477f
commit 3af27e0d24

View File

@ -2256,12 +2256,21 @@ void createSharedObjects(void) {
void initMasterInfo(redisMaster *master) void initMasterInfo(redisMaster *master)
{ {
master->masterauth = NULL; if (server.default_masterauth)
master->masterhost = NULL; master->masterauth = zstrdup(server.default_masterauth);
else
master->masterauth = NULL;
if (server.default_masteruser)
master->masteruser = zstrdup(server.default_masteruser);
else
master->masteruser = NULL;
master->masterport = 6379; master->masterport = 6379;
master->master = NULL; master->master = NULL;
master->cached_master = NULL; master->cached_master = NULL;
master->master_initial_offset = -1; master->master_initial_offset = -1;
master->repl_state = REPL_STATE_NONE; master->repl_state = REPL_STATE_NONE;
master->repl_down_since = 0; /* Never connected, repl is down since EVER. */ master->repl_down_since = 0; /* Never connected, repl is down since EVER. */