From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gustavsson Mikael <mikael.gustavsson@smhi.se>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: Svensson Peter <peter.svensson@smhi.se>
Subject: Re: Problem with ssl and psql in Postgresql 13
Date: Wed, 30 Dec 2020 10:00:40 -0500
Message-ID: <20201230150039.GZ27507@tamriel.snowman.net> (raw)
In-Reply-To: <2187460.1609263156@sss.pgh.pa.us>
References: <737386.1608757126@sss.pgh.pa.us>
<20201223211448.GR27507@tamriel.snowman.net>
<738715.1608758847@sss.pgh.pa.us>
<20201223214534.GS27507@tamriel.snowman.net>
<740093.1608760567@sss.pgh.pa.us>
<742641.1608762845@sss.pgh.pa.us>
<1308863.1609016410@sss.pgh.pa.us>
<1333636.1609020377@sss.pgh.pa.us>
<1528843.1609108374@sss.pgh.pa.us>
<2187460.1609263156@sss.pgh.pa.us>
Greetings,
First, thanks a lot for working on all of this and improving things!
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> I've got one last complaint about the backend GSS code: we are doing
> things randomly differently in the two places that install
> krb_server_keyfile as the active KRB5_KTNAME value. secure_open_gssapi()
> sets KRB5_KTNAME unconditionally (and doesn't bother to check for error,
> either, not a good thing in a security-critical operation). But the older
> code in pg_GSS_recvauth() is written to not override KRB5_KTNAME if it's
> already set. This of-course-totally-undocumented behavior seems like a
> fairly bad idea to me: as things stand, the client-side choice of whether
> to initiate GSS encryption or not could result in two different server
> keytabs being used.
I agree that we should be consistent and that always setting the
environment variable if krb_server_keyfile has been set is the right
approach.
> I think we'd be best off to always override KRB5_KTNAME if we have a
> nonempty krb_server_keyfile setting, so the attached proposed patch
> makes both functions do it the same way. (I did not make an effort
> to remove the dependency on setenv, given the nearby thread to
> standardize on that.)
+1.
> I'm not sure whether there's any documentation change that needs to
> be made. The docs don't suggest that you're allowed to set
> krb_server_keyfile to an empty string in the first place, so maybe
> we needn't explain what happens if you do.
Perhaps saying something about 'system default' or 'taken from the
environment' might make sense. That said, the system default almost
always ends up not being usable since it'll be owned by root and we
won't run as root. Perhaps there are some who prefer to set it via the
environment variable, though I don't think I've ever seen that myself.
I didn't look too closely at the patch itself but on a once-over it
seemed fine to me.
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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 using the --to and --cc options:
reply via email
To: pgsql-general@postgresql.org
Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, mikael.gustavsson@smhi.se, magnus@hagander.net, horikyota.ntt@gmail.com, peter.svensson@smhi.se
Subject: Re: Problem with ssl and psql in Postgresql 13
In-Reply-To: <20201230150039.GZ27507@tamriel.snowman.net>
* 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