From b8b70e772e88d505460ce25bf79757461a6278c5 Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 30 Jul 2021 07:24:55 -0400 Subject: [PATCH] [client] config: print error when app:configFile is not a valid file This makes it clear to the user that app:configFile is at fault. --- client/src/config.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/config.c b/client/src/config.c index 85ad1c93..dd69f8c3 100644 --- a/client/src/config.c +++ b/client/src/config.c @@ -503,6 +503,12 @@ bool config_load(int argc, char * argv[]) const char * configFile = option_get_string("app", "configFile"); if (configFile) { + if (stat(configFile, &st) < 0 || !S_ISREG(st.st_mode)) + { + DEBUG_ERROR("app:configFile set to invalid file: %s", configFile); + return false; + } + DEBUG_INFO("Loading config from: %s", configFile); if (!option_load(configFile)) return false;