summaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/pg_upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_upgrade/pg_upgrade.c')
-rw-r--r--src/bin/pg_upgrade/pg_upgrade.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index ed0ac928622..78f356c24c8 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -77,6 +77,10 @@ main(int argc, char **argv)
bool live_check = false;
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_upgrade"));
+
+ /* Ensure that all files created by pg_upgrade are non-world-readable */
+ umask(S_IRWXG | S_IRWXO);
+
parseCommandLine(argc, argv);
get_restricted_token(os_info.progname);