mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
repmgr: in switchover mode, prevent checks for local config file if not provided
In switchover mode, if no remote repmgr config file is provided with `-C`, repmgr attempts to look for a file with the same path as the local file (provided with `-f/--config-file`). However if this was not specified, repmgr would execute `ls` with an empty filepath on the remote host, which appeared to succeed, causing subsequent remote repmgr command executions to fail as a blank value was provided for `-f/--config-file`. Fixes GitHub #229.
This commit is contained in:
7
repmgr.c
7
repmgr.c
@@ -4003,6 +4003,13 @@ do_standby_switchover(void)
|
||||
|
||||
for(i = 0; config_paths[i] && config_file_found == false; ++i)
|
||||
{
|
||||
/*
|
||||
* Don't attempt to check for an empty filename - this might be the case
|
||||
* if no local configuration file was found.
|
||||
*/
|
||||
if (!strlen(config_paths[i]))
|
||||
continue;
|
||||
|
||||
log_verbose(LOG_INFO, _("checking \"%s\"\n"), config_paths[i]);
|
||||
|
||||
maxlen_snprintf(command,
|
||||
|
||||
Reference in New Issue
Block a user