From: Stephen Frost <sfrost@snowman.net>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robbie Harwood <rharwood@redhat.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: weird libpq GSSAPI comment
Date: Mon, 6 Jan 2020 16:53:49 -0500
Message-ID: <20200106215349.GL3195@tamriel.snowman.net> (raw)
In-Reply-To: <20200106213817.GA29411@alvherre.pgsql>
References: <20200106210322.GJ3195@tamriel.snowman.net>
<20200106213817.GA29411@alvherre.pgsql>
Greetings,
* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
> On 2020-Jan-06, Stephen Frost wrote:
>
> > > I wonder if part of the confusion might be due to the synonyms we're
> > > using here for "in use". Things seem to be "got running", "set up",
> > > "operating", "negotiated", ... - maybe that's part of the barrier to
> > > understanding?
> >
> > How about something like this?
> >
> > * If GSSAPI Encryption is enabled, then call pg_GSS_have_cred_cache()
> > * which will return true if we can acquire credentials (and give us a
> > * handle to use in conn->gcred), and then send a packet to the server
> > * asking for GSSAPI Encryption (and skip past SSL negotiation and
> > * regular startup below).
>
> WFM. (I'm not sure why you uppercase Encryption, though.)
Ok, great, attached is an actual patch which I'll push soon if there
aren't any other comments.
Thanks!
Stephen
Attachments:gssapi_encryption_startup_comment_fix_v1.patch (text/x-diff, 1.4K) download
From 49a57d5040c487c65cd9968504e978d11b4aefca Mon Sep 17 00:00:00 2001
From: Stephen Frost <sfrost@snowman.net>
Date: Mon, 6 Jan 2020 16:49:02 -0500
Subject: [PATCH] Improve GSSAPI Encryption startup comment in libpq
The original comment was a bit confusing, pointed out by Alvaro Herrera.
Thread: https://postgr.es/m/20191224151520.GA16435%40alvherre.pgsql
---
src/interfaces/libpq/fe-connect.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.cindex 3bd30482ec..89b134665b 100644--- a/src/interfaces/libpq/fe-connect.c+++ b/src/interfaces/libpq/fe-connect.c@@ -2800,10 +2800,12 @@ keep_going: /* We will come back to here until there is
#ifdef ENABLE_GSS
/*
- * If GSSAPI is enabled and we have a credential cache, try to- * set it up before sending startup messages. If it's already- * operating, don't try SSL and instead just build the startup- * packet.+ * If GSSAPI encryption is enabled, then call+ * pg_GSS_have_cred_cache() which will return true if we can+ * acquire credentials (and give us a handle to use in+ * conn->gcred), and then send a packet to the server asking+ * for GSSAPI Encryption (and skip past SSL negotiation and+ * regular startup below).
*/
if (conn->try_gss && !conn->gctx)
conn->try_gss = pg_GSS_have_cred_cache(&conn->gcred);
--
2.20.1
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 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: sfrost@snowman.net, alvherre@2ndquadrant.com, rharwood@redhat.com
Subject: Re: weird libpq GSSAPI comment
In-Reply-To: <20200106215349.GL3195@tamriel.snowman.net>
References: <20200106210322.GJ3195@tamriel.snowman.net> <20200106213817.GA29411@alvherre.pgsql> <20200106215349.GL3195@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