From 354231284e259f6626600a91d75087315753e34b Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 1 Mar 2018 10:38:37 +0900 Subject: [PATCH] repmgr: escape "restore_command" in generated recovery.conf --- repmgr-action-standby.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 22728de5..743633de 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -5639,11 +5639,14 @@ create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_c * If restore_command is set, we use it as restore_command in * recovery.conf */ - if (strcmp(config_file_options.restore_command, "") != 0) + if (config_file_options.restore_command[0] != '\0') { + char *escaped = escape_recovery_conf_value(config_file_options.restore_command); + appendPQExpBuffer(&recovery_file_buf, "restore_command = '%s'\n", - config_file_options.restore_command); + escaped); + free(escaped); } if (as_file == true)