Re: Setting restrictedtoken in pg_regress

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Daniel Gustafsson <daniel@yesql.se>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andrew Dunstan <andrew@dunslane.net>
Date: 2023-06-12T23:43:09Z
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



Commits

  1. pg_regress: Remove unused variable