From fb8296644dbdee5fb001aca893476d263704b35a Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 9 Mar 2015 08:25:35 +0900 Subject: [PATCH] Canonicalize configuration file path --- config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 0b00929d..5534d258 100644 --- a/config.c +++ b/config.c @@ -58,7 +58,11 @@ parse_config(const char *config_file, t_configuration_options *options) if (config_file[0]) { struct stat config; - if(stat(config_file, &config) != 0) + + strncpy(config_file_buf, config_file, MAXLEN); + canonicalize_path(config_file_buf); + + if(stat(config_file_buf, &config) != 0) { log_err(_("Provided configuration file '%s' not found: %s\n"), config_file, @@ -66,7 +70,7 @@ parse_config(const char *config_file, t_configuration_options *options) ); exit(ERR_BAD_CONFIG); } - strncpy(config_file_buf, config_file, MAXLEN); + config_file_provided = true; }