mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
Canonicalize configuration file path
This commit is contained in:
8
config.c
8
config.c
@@ -58,7 +58,11 @@ parse_config(const char *config_file, t_configuration_options *options)
|
|||||||
if (config_file[0])
|
if (config_file[0])
|
||||||
{
|
{
|
||||||
struct stat config;
|
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"),
|
log_err(_("Provided configuration file '%s' not found: %s\n"),
|
||||||
config_file,
|
config_file,
|
||||||
@@ -66,7 +70,7 @@ parse_config(const char *config_file, t_configuration_options *options)
|
|||||||
);
|
);
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
strncpy(config_file_buf, config_file, MAXLEN);
|
|
||||||
config_file_provided = true;
|
config_file_provided = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user