From 32168a5e8ae25df47d0549a548c544c60d264609 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Mon, 4 Aug 2014 12:28:45 -0400 Subject: [PATCH] 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 --- src/redis.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/redis.c b/src/redis.c index 48eca652..785cf6e5 100644 --- a/src/redis.c +++ b/src/redis.c @@ -3275,6 +3275,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); -- GitLab