From 331eca447a487dc14889c0734c21287ad2157af0 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Tue, 12 Jun 2012 09:32:03 -0500 Subject: [PATCH] STANDBY CLONE should be run by a SUPERUSER, otherwise we won't be able to retrieve data_directory and the other parameters we need by querying the database. --- repmgr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repmgr.c b/repmgr.c index ef6e7944..5ba74db2 100644 --- a/repmgr.c +++ b/repmgr.c @@ -843,6 +843,16 @@ do_standby_clone(void) PQfinish(conn); exit(ERR_BAD_CONFIG); } + + /* We need all 5 parameters, and they can be retrieved only by superusers */ + if (PQntuples(res) != 5) + { + log_err("%s: STANDBY CLONE should be run by a SUPERUSER\n", progname); + PQclear(res); + PQfinish(conn); + exit(ERR_BAD_CONFIG); + } + for (i = 0; i < PQntuples(res); i++) { if (strcmp(PQgetvalue(res, i, 0), "data_directory") == 0)