Re: Setting restrictedtoken in pg_regress - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Setting restrictedtoken in pg_regress
Date
Msg-id 8D4232D8-ADB7-40CA-A6F5-2399342C00A8@yesql.se
Whole thread Raw
In response to Re: Setting restrictedtoken in pg_regress  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
> On 14 Jun 2023, at 13:02, Andrew Dunstan <andrew@dunslane.net> wrote:
> On 2023-06-12 Mo 19:43, Nathan Bossart wrote:
>> On Tue, Jun 13, 2023 at 08:29:19AM +0900, Michael Paquier wrote:
>>
>>> I am actually a bit confused with the return value of
>>> CreateRestrictedProcess() on failures in restricted_token.c.  Wouldn't
>>> it be cleaner to return INVALID_HANDLE_VALUE rather than 0 in these
>>> cases?
>>>
>> My suspicion is that this was chosen to align with CreateProcess and to
>> allow things like
>>
>>     if (!CreateRestrictedProcess(...))
>
> Probably, it's been a while. I doubt it's worth changing at this point, and we could just change pg_regress.c to use
aboolean test like the above. 

Done that way and pushed, thanks!

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)
Next
From: Justin Pryzby
Date:
Subject: Re: warn if GUC set to an invalid shared library