From the "scratch a long running itch" department.


The attached ridiculously tiny patch solves the problem whereby while we can run Postgres on Windows safely from an Administrator account, we can't run run the regression tests from the same account, since it fails on the tablespace test, the tablespace directory having been set up without first having lowered privileges. The solution is to lower pg_regress' privileges in the same way that we do with other binaries. This is useful in setups like Appveyor where running under any other account is ... difficult. For the cfbot Thomas has had to make the script hack the schedule file to omit the tablespace test. This would make that redundant.


I propose to backpatch this. It's close enough to a bug and the risk is almost infinitely small.


cheers


andrew


--
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 6890678..3248603 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2081,6 +2081,8 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
 	progname = get_progname(argv[0]);
 	set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_regress"));
 
+	get_restricted_token(progname);
+
 	atexit(stop_postmaster);
 
 #ifndef HAVE_UNIX_SOCKETS

Reply via email to