Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o42eh-0007fs-W5 for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jun 2022 15:52:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o42eg-0003vD-QT for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jun 2022 15:52:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o42eg-0003v4-Hf for pgsql-hackers@lists.postgresql.org; Wed, 22 Jun 2022 15:52:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o42ee-0006ui-63 for pgsql-hackers@lists.postgresql.org; Wed, 22 Jun 2022 15:52:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25MFqRSU3484654; Wed, 22 Jun 2022 11:52:27 -0400 From: Tom Lane To: Jacob Champion cc: Joe Conway , "Drouvot, Bertrand" , PostgreSQL Hackers Subject: Re: SYSTEM_USER reserved word implementation In-reply-to: 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> Comments: In-reply-to Jacob Champion message dated "Wed, 22 Jun 2022 08:35:02 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3484652.1655913147.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 22 Jun 2022 11:52:27 -0400 Message-ID: <3484653.1655913147@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jacob Champion writes: > On Wed, Jun 22, 2022 at 8:10 AM Joe Conway wrote: >> In case port->authn_id is NULL then the patch is returning the SESSION_= USER for the SYSTEM_USER. Perhaps it should return NULL instead. > If the spec says that SYSTEM_USER "represents the operating system > user", but we don't actually know who that user was (authn_id is > NULL), then I think SYSTEM_USER should also be NULL so as not to > mislead auditors. Yeah, that seems like a fundamental type mismatch. If we don't know the OS user identifier, substituting a SQL role name is surely not the right thing. I think a case could be made for ONLY returning non-null when authn_id represents some externally-verified identifier (OS user ID gotten via peer identification, Kerberos principal, etc). regards, tom lane