Skip to content

Commit

Permalink
Reset masterauth if an empty string is configured.
Browse files Browse the repository at this point in the history
  • Loading branch information
soveran authored and antirez committed May 2, 2013
1 parent 9cd06e4 commit 649b304
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,11 @@ void configSetCommand(redisClient *c) {
server.requirepass = ((char*)o->ptr)[0] ? zstrdup(o->ptr) : NULL;
} else if (!strcasecmp(c->argv[2]->ptr,"masterauth")) {
zfree(server.masterauth);
server.masterauth = zstrdup(o->ptr);
if (sdslen(o->ptr)) {
server.masterauth = zstrdup(o->ptr);
} else {
server.masterauth = NULL;
}
} else if (!strcasecmp(c->argv[2]->ptr,"maxmemory")) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR ||
ll < 0) goto badfmt;
Expand Down

0 comments on commit 649b304

Please sign in to comment.