diff options
author | Michel Martens <michel@soveran.com> | 2013-04-25 11:06:10 -0300 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-05-02 17:19:11 +0200 |
commit | 649b304e0f01d59e9ee3eb6fb522e1cc9c8e1940 (patch) | |
tree | 6ec5e11a81456c3940df6086956ad6cd970fa188 | |
parent | 9cd06e4406377254c4d788299d11e4a040c200d6 (diff) | |
download | redis-649b304e0f01d59e9ee3eb6fb522e1cc9c8e1940.tar.gz |
Reset masterauth if an empty string is configured.
-rw-r--r-- | src/config.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 6d2b6829a..ec51766ee 100644 --- a/src/config.c +++ b/src/config.c @@ -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; |