Sentinel: Reject config from STDIN

Sentinel needs to die with a more accurate error message
when attempted to open a config from STDIN.

See: https://groups.google.com/forum/#!topic/redis-db/sYx7VNMWaNM
This commit is contained in:
Matt Stancliff 2014-08-04 12:28:45 -04:00 committed by antirez
parent 60c448b584
commit 681de88df4

View File

@ -3576,6 +3576,13 @@ int main(int argc, char **argv) {
}
j++;
}
if (server.sentinel_mode && configfile && *configfile == '-') {
redisLog(REDIS_WARNING,
"Sentinel config from STDIN not allowed.");
redisLog(REDIS_WARNING,
"Sentinel needs config file on disk to save state. Exiting...");
exit(1);
}
if (configfile) server.configfile = getAbsolutePath(configfile);
resetServerSaveParams();
loadServerConfig(configfile,options);