From 5d5aeddabfe0b6b21f556c72a71e0454833d63e5 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 9 Apr 2018 21:33:33 +0200 Subject: [PATCH] Make sure pg_rewind can't run as root Previously a warning was printed, but the tool actually kept running even when running as root. This is something we definitely want to prevent, but since this means a behavior change, not backpatching. Author: Michael Paquier --- src/bin/pg_rewind/pg_rewind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index b9ea6a4c21..a1ab13963a 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -208,6 +208,7 @@ main(int argc, char **argv) fprintf(stderr, _("cannot be executed by \"root\"\n")); fprintf(stderr, _("You must run %s as the PostgreSQL superuser.\n"), progname); + exit(1); } #endif