提交 32168a5e 编写于 作者: M Matt Stancliff 提交者: antirez

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
上级 4bf7c5d0
...@@ -3275,6 +3275,13 @@ int main(int argc, char **argv) { ...@@ -3275,6 +3275,13 @@ int main(int argc, char **argv) {
} }
j++; 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); if (configfile) server.configfile = getAbsolutePath(configfile);
resetServerSaveParams(); resetServerSaveParams();
loadServerConfig(configfile,options); loadServerConfig(configfile,options);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册