From: Joe Conway <mail@joeconway.com>
To: Jacob Champion <jchampion@timescale.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: SYSTEM_USER reserved word implementation
Date: Wed, 22 Jun 2022 12:26:46 -0400
Message-ID: <075c68a2-72a6-1be4-34da-25e73e60016d@joeconway.com> (raw)
In-Reply-To: <CAAWbhmj=zsgBac593B4RdHTNVVNUFedgQ2CH-h9STD7USSMqTw@mail.gmail.com>
References: <7e692b8c-0b11-45db-1cad-3afc5b57409f@amazon.com>
<3338921.1655905757@sss.pgh.pa.us>
<28b4a9ef-5103-f117-99e1-99ae5a86a6e8@joeconway.com>
<3361134.1655909496@sss.pgh.pa.us>
<89d0577e-b9f8-4d8a-224d-b336a5fe08af@joeconway.com>
<CAAWbhmj=zsgBac593B4RdHTNVVNUFedgQ2CH-h9STD7USSMqTw@mail.gmail.com>
On 6/22/22 11:35, Jacob Champion wrote:
> On Wed, Jun 22, 2022 at 8:10 AM Joe Conway <mail@joeconway.com> wrote:
>> --- a/src/backend/utils/init/miscinit.c
>> +++ b/src/backend/utils/init/miscinit.c
>> @@ -473,6 +473,7 @@ static Oid AuthenticatedUserId = InvalidOid;
>> static Oid SessionUserId = InvalidOid;
>> static Oid OuterUserId = InvalidOid;
>> static Oid CurrentUserId = InvalidOid;
>> +static const char *SystemUser = NULL;
>>
>> /* We also have to remember the superuser state of some of these levels */
>> static bool AuthenticatedUserIsSuperuser = false;
>
> What's the rationale for introducing a new global for this? A downside
> is that now there are two sources of truth, for a security-critical
> attribute of the connection.
Why would you want to do it differently than
SessionUserId/OuterUserId/CurrentUserId? It is analogous, no?
--
Joe Conway
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: mail@joeconway.com, jchampion@timescale.com, tgl@sss.pgh.pa.us, bdrouvot@amazon.com
Subject: Re: SYSTEM_USER reserved word implementation
In-Reply-To: <075c68a2-72a6-1be4-34da-25e73e60016d@joeconway.com>
References: <7e692b8c-0b11-45db-1cad-3afc5b57409f@amazon.com> <3338921.1655905757@sss.pgh.pa.us> <28b4a9ef-5103-f117-99e1-99ae5a86a6e8@joeconway.com> <3361134.1655909496@sss.pgh.pa.us> <89d0577e-b9f8-4d8a-224d-b336a5fe08af@joeconway.com> <CAAWbhmj=zsgBac593B4RdHTNVVNUFedgQ2CH-h9STD7USSMqTw@mail.gmail.com> <075c68a2-72a6-1be4-34da-25e73e60016d@joeconway.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox