From: Magnus Hagander Date: Mon, 9 Apr 2018 19:33:33 +0000 (+0200) Subject: Make sure pg_rewind can't run as root X-Git-Tag: REL_11_BETA1~279 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d5aeddabfe0b6b21f556c72a71e0454833d63e5;p=postgresql 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 --- 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