Re: Setting restrictedtoken in pg_regress

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: Setting restrictedtoken in pg_regress
Date: 2023-06-12 23:43:09
Message-ID: 20230612234309.GC180938@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-06-13 00:16:07 Re: query_id, pg_stat_activity, extended query protocol
Previous Message Nathan Bossart 2023-06-12 23:30:15 Re: [PATCH] Slight improvement of worker_spi.c example