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

From Nathan Bossart
Subject Re: Setting restrictedtoken in pg_regress
Date
Msg-id 20230612234309.GC180938@nathanxps13
Whole thread Raw
In response to Re: Setting restrictedtoken in pg_regress  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Setting restrictedtoken in pg_regress
List pgsql-hackers
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(...))

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: [PATCH] Slight improvement of worker_spi.c example
Next
From: Michael Paquier
Date:
Subject: Re: query_id, pg_stat_activity, extended query protocol