From 681de88df4814a4a6e794a07530a3865ef515d2c 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 c1b269596..eb8bfbc65 100644 --- a/src/redis.c +++ b/src/redis.c @@ -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);