diff options
author | antirez <antirez@gmail.com> | 2014-01-13 11:55:57 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-01-13 16:39:56 +0100 |
commit | df00b6ac0577f89b209a740d9fa96f35d54f5692 (patch) | |
tree | 3b49068e95a923f700cf5fe34cabde3fb4b11612 | |
parent | b8db8a0c4812b5db9573b19a9b05b4182dc94561 (diff) | |
download | redis-df00b6ac0577f89b209a740d9fa96f35d54f5692.tar.gz |
SENTINEL SET: error on bad option name + flush config on error.
-rw-r--r-- | src/sentinel.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c index 3658c6162..aa5c0a6af 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2646,6 +2646,7 @@ void sentinelSetCommand(redisClient *c) { if (strlen(value) && access(value,X_OK) == -1) { addReplyError(c, "Notification script seems non existing or non executable"); + if (changes) sentinelFlushConfig(); return; } sdsfree(ri->notification_script); @@ -2657,6 +2658,7 @@ void sentinelSetCommand(redisClient *c) { addReplyError(c, "Client reconfiguration script seems non existing or " "non executable"); + if (changes) sentinelFlushConfig(); return; } sdsfree(ri->client_reconfig_script); @@ -2667,6 +2669,11 @@ void sentinelSetCommand(redisClient *c) { sdsfree(ri->auth_pass); ri->auth_pass = strlen(value) ? sdsnew(value) : NULL; changes++; + } else { + addReplyErrorFormat(c,"Unknown option '%s' for SENTINEL SET", + option); + if (changes) sentinelFlushConfig(); + return; } } |