]> granicus.if.org Git - postgresql/commitdiff
Make sure pg_rewind can't run as root
authorMagnus Hagander <magnus@hagander.net>
Mon, 9 Apr 2018 19:33:33 +0000 (21:33 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 9 Apr 2018 19:33:33 +0000 (21:33 +0200)
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

index b9ea6a4c213aba281c0f34e3ef5d4c1feb9de439..a1ab13963a7ad38db0817d09a2de2de864841f6e 100644 (file)
@@ -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