diff options
author | Michael Paquier <michael@paquier.xyz> | 2020-02-07 10:51:17 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2020-02-07 10:51:17 +0900 |
commit | dcddc3f813ff39d0e33c2b7c77092a6c0b0e9d0b (patch) | |
tree | 6b56696dfc0114b725b4889693f3caaf94564931 /src | |
parent | 414c2fd1e1c0ccd1af1cad046bef1264e3f4347f (diff) | |
download | postgresql-dcddc3f813ff39d0e33c2b7c77092a6c0b0e9d0b.tar.gz postgresql-dcddc3f813ff39d0e33c2b7c77092a6c0b0e9d0b.zip |
Revert "Prevent running pg_basebackup as root"
This reverts commit 7bae0ad, as this is not ideal with the tar format,
and we may want to explore more options like what is done by tar with
some equivalents of --owner and --group, but for pg_basebackup.
Per complaints from Magnus Hagander and Stephen Frost.
Discussion: https://postgr.es/m/20200205172259.GW3195@tamriel.snowman.net
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 4e12cdb4467..2551cf38c91 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -2090,22 +2090,6 @@ main(int argc, char **argv) } } - /* - * Don't allow pg_basebackup to be run as root, to avoid creating files in - * the data directory with ownership rights incompatible with the - * postmaster. - */ -#ifndef WIN32 - if (geteuid() == 0) /* 0 is root's uid */ - { - pg_log_error("cannot be run as root"); - fprintf(stderr, - _("Please log in (using, e.g., \"su\") as the (unprivileged) user that will\n" - "own the server process.\n")); - exit(1); - } -#endif - atexit(cleanup_directories_atexit); while ((c = getopt_long(argc, argv, "CD:F:r:RS:T:X:l:nNzZ:d:c:h:p:U:s:wWkvP", |