pgsql: Handle errors during GSSAPI startup better

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Handle errors during GSSAPI startup better
Date: 2019-04-05 02:54:35
Message-ID: E1hCEzz-0000z1-Sn@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Handle errors during GSSAPI startup better

There was some confusion over the format of the error message returned
from the server during GSSAPI startup; specifically, it was expected
that a length would be returned when, in reality, at this early stage in
the startup sequence, no length is returned from the server as part of
an error message.

Correct the client-side code for dealing with error messages sent by the
server during startup by simply reading what's available into our
buffer, after we've discovered it's an error message, and then reporting
back what was returned.

In passing, also add in documentation of the environment variable
PGGSSENCMODE which was missed previously, and adjust the code to look
for the PGGSSENCMODE variable (the environment variable change was
missed in the prior GSSMODE -> GSSENCMODE commit).

Error-handling issue discovered by Peter Eisentraut, the rest were items
discovered during testing of the error handling.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c46c85d4594d52fb34d36d4761bb9cfc5626f20b

Modified Files
--------------
doc/src/sgml/libpq.sgml | 10 ++++++++++
src/interfaces/libpq/fe-connect.c | 4 ++--
src/interfaces/libpq/fe-secure-gssapi.c | 34 ++++++++-------------------------
3 files changed, 20 insertions(+), 28 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2019-04-05 04:50:00 pgsql: Fix bugs in mdsyncfiletag().
Previous Message David Rowley 2019-04-05 01:47:30 Re: pgsql: Generated columns