Re: lowering pg_regress privileges on Windows - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: lowering pg_regress privileges on Windows
Date
Msg-id 20181019001341.GD2099@paquier.xyz
Whole thread Raw
In response to lowering pg_regress privileges on Windows  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Responses Re: lowering pg_regress privileges on Windows  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
On Thu, Oct 18, 2018 at 08:31:11AM -0400, Andrew Dunstan wrote:
> 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.

+1.  get_restricted_token() refactoring has been done down to
REL9_5_STABLE.  With 9.4 and older you would need to copy again this
full routine into pg_regress.c, which is in my opinion not worth
worrying about.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Function to promote standby servers
Next
From: Thomas Munro
Date:
Subject: Re: lowering pg_regress privileges on Windows