From: Drouvot, Bertrand <bdrouvot@amazon.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Jacob Champion <jchampion@timescale.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joe Conway <mail@joeconway.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: SYSTEM_USER reserved word implementation
Date: Wed, 24 Aug 2022 20:26:50 +0200
Message-ID: <1da0e60c-bd85-9f2d-2039-103055338b00@amazon.com> (raw)
In-Reply-To: <YwWooBzPlfzncJea@paquier.xyz>
References: <20220627173250.46lvecpvuunc7pf5@alvherre.pgsql>
<c2727e30-a3d3-465f-f253-bfff81611a21@amazon.com>
<24d638c7-16f6-afb9-c25c-6a29c169210e@amazon.com>
<CAAWbhmiPwGCevz_FS3rRK5fWQ8RiLW2bPVABzJVDxVWCuMFdmg@mail.gmail.com>
<8fe1752a-2e3d-4ee8-656c-0caf5d860b0e@amazon.com>
<db5f852b-7e22-7b25-a0f3-5b4a67cd5be9@amazon.com>
<YwWooBzPlfzncJea@paquier.xyz>
Hi,
On 8/24/22 6:27 AM, Michael Paquier wrote:
> On Wed, Aug 17, 2022 at 04:48:42PM +0200, Drouvot, Bertrand wrote:
>> That way one could test the SYSTEM_USER behavior without the need to have
>> kerberos enabled.
> I was looking at this patch
Thanks for looking at it!
> and noticed that SYSTEM_USER returns a
> "name", meaning that the value would be automatically truncated at 63
> characters. We shouldn't imply that as authn_ids can be longer than
> that, and this issue gets a bit worse once with the auth_method
> appended to the string.
Good catch! I'll fix that in the next version.
Hmm, I think it would make sense to keep system_user() with his friends
current_user() and session_user().
But now that system_user() will not return a name anymore (but a text),
I think name.c is no longer the right place, what do you think? (If so,
where would you suggest?)
>
> +if (!$use_unix_sockets)
> +{
> + plan skip_all =>
> + "authentication tests cannot run without Unix-domain sockets";
> +}
>
> Are you sure that !$use_unix_sockets is safe here? Could we have
> platforms where we use our port's getpeereid() with $use_unix_sockets
> works? That would cause the test to fail with ENOSYS. Hmm. Without
> being able to rely on HAVE_GETPEEREID, we could check for the error
> generated when the fallback implementation does not work, and skip the
> rest of the test.
Oh right, I did not think about that, thanks for the suggestion.
I'll change this in the next version and simply skip the rest of the
test in case we get "peer authentication is not supported on this platform".
Regards,
--
Bertrand Drouvot
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: bdrouvot@amazon.com, michael@paquier.xyz, jchampion@timescale.com, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, mail@joeconway.com
Subject: Re: SYSTEM_USER reserved word implementation
In-Reply-To: <1da0e60c-bd85-9f2d-2039-103055338b00@amazon.com>
References: <20220627173250.46lvecpvuunc7pf5@alvherre.pgsql> <c2727e30-a3d3-465f-f253-bfff81611a21@amazon.com> <24d638c7-16f6-afb9-c25c-6a29c169210e@amazon.com> <CAAWbhmiPwGCevz_FS3rRK5fWQ8RiLW2bPVABzJVDxVWCuMFdmg@mail.gmail.com> <8fe1752a-2e3d-4ee8-656c-0caf5d860b0e@amazon.com> <db5f852b-7e22-7b25-a0f3-5b4a67cd5be9@amazon.com> <YwWooBzPlfzncJea@paquier.xyz> <1da0e60c-bd85-9f2d-2039-103055338b00@amazon.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