From dd5ac660bfb7d0257b8715ffb16befdabae04469 Mon Sep 17 00:00:00 2001 From: Dan Farina Date: Thu, 23 Dec 2010 00:53:31 -0800 Subject: [PATCH] Comments and cleanup Signed-off-by: Dan Farina --- repmgr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repmgr.c b/repmgr.c index a89b49ea..ee424a98 100644 --- a/repmgr.c +++ b/repmgr.c @@ -1356,6 +1356,14 @@ create_recovery_file(const char *data_dir, char *master_conninfo) return false; } + /* + * Template a password into the connection string in recovery.conf. + * Sometimes this is passed by the user explicitly, and otherwise we try to + * get it into th environment + * + * XXX: This is pretty dirty, at least push this up to the caller rather + * than hitting environment variables at this level. + */ if (master_conninfo == NULL) { char *password = getenv("PGPASSWORD"); @@ -1374,9 +1382,7 @@ create_recovery_file(const char *data_dir, char *master_conninfo) password); } else - { maxlen_snprintf(line, "primary_conninfo = '%s'\n", master_conninfo); - } if (fputs(line, recovery_file) == EOF) {