Re: weird libpq GSSAPI comment

Stephen Frost <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.general
Message-ID <[email protected]>
Greetings,

* Alvaro Herrera ([email protected]) 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
gssapi_encryption_startup_comment_fix_v1.patch (text/x-diff, 1.4 KB)
From 49a57d5040c487c65cd9968504e978d11b4aefca Mon Sep 17 00:00:00 2001
From: Stephen Frost <[email protected]>
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.c
index 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, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJeE6xtAAoJEO1sijiDR2RV6qQP/1OmLWH9W1/pexg4gLfikcgR
1NkRBnE1mdQVXJLUOPy7VmOybTXBESIXAwIz1BS+EAq/7uHQsUemlxf38bOQMgxX
AJP8PbjF85OVTr05Qs8igLZehl1i2YHgAAtT5JmDnvgPYdy9xaufbvNRRyRQkzp8
AOqlxotZBI8QzUDRM2nNrcQLJmxWJCDDTWrFwkpX4Lilsi4CDJbRPB3cbr5M2upE
u5NCc1aep++qKCaULhyc8uBqHV1QwvfmLHZ08Mr8nOs8wHeYU18CKa1TrxOaqWsR
YKdvoEK74xsPz/xZV6KHwU0CZagSkwab3TMDKba1kLYLQEhtPdhis/MPc4IM6THJ
25xVA4eV13pg71zivLvok5CxQ/bvE6GcaCPnX+iWOhAzgGLYlr7BNr2/phadYtM+
6+BXWmS3EvWttdJrdrh3j/rA7YDRaXwxiQLYjNQxAwP1j2Qc5HCYDrwmSzIOXqy1
bfYStwJmSOvsv+pjv+0tj1S0/fLX9sjkwLMbQJ92u7CsyoHZfGejAbP6JjQuKXwq
7Mm23iWnsTAZDTSPqE2ep4pODnJU4K38MpU6Qr6QwWzXUpvjgef2WoC8aYTXtMJh
ZF9S6bPkNiKXDWSa3qM4LhA/nnlzaPopwd38CSX1AqZD7Zoos8YGUUSL7SDg922l
sV0pSs71kdJrtSOXeM10
=qx5M
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.