Commit df00b6ac authored by antirez's avatar antirez
Browse files

SENTINEL SET: error on bad option name + flush config on error.

parent b8db8a0c
...@@ -2646,6 +2646,7 @@ void sentinelSetCommand(redisClient *c) { ...@@ -2646,6 +2646,7 @@ void sentinelSetCommand(redisClient *c) {
if (strlen(value) && access(value,X_OK) == -1) { if (strlen(value) && access(value,X_OK) == -1) {
addReplyError(c, addReplyError(c,
"Notification script seems non existing or non executable"); "Notification script seems non existing or non executable");
if (changes) sentinelFlushConfig();
return; return;
} }
sdsfree(ri->notification_script); sdsfree(ri->notification_script);
...@@ -2657,6 +2658,7 @@ void sentinelSetCommand(redisClient *c) { ...@@ -2657,6 +2658,7 @@ void sentinelSetCommand(redisClient *c) {
addReplyError(c, addReplyError(c,
"Client reconfiguration script seems non existing or " "Client reconfiguration script seems non existing or "
"non executable"); "non executable");
if (changes) sentinelFlushConfig();
return; return;
} }
sdsfree(ri->client_reconfig_script); sdsfree(ri->client_reconfig_script);
...@@ -2667,6 +2669,11 @@ void sentinelSetCommand(redisClient *c) { ...@@ -2667,6 +2669,11 @@ void sentinelSetCommand(redisClient *c) {
sdsfree(ri->auth_pass); sdsfree(ri->auth_pass);
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL; ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
changes++; changes++;
} else {
addReplyErrorFormat(c,"Unknown option '%s' for SENTINEL SET",
option);
if (changes) sentinelFlushConfig();
return;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment