]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix inconsistent error handling for GSS encryption in PQconnectPoll()
authorMichael Paquier <michael@paquier.xyz>
Mon, 13 Mar 2023 07:36:34 +0000 (16:36 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 13 Mar 2023 07:36:34 +0000 (16:36 +0900)
commit2bc36a56cbd15415f85f3364044b778b21b0504c
treeef9f2c7504e5d98cdf088e241490f002a381b23a
parent13196cc755982e9cbccf92be67e36d5480e73edc
Fix inconsistent error handling for GSS encryption in PQconnectPoll()

The error cases for TLS and GSS encryption were inconsistent.  After TLS
fails, the connection is marked as dead and follow-up calls of
PQconnectPoll() would return immediately, but GSS encryption was not
doing that, so the connection would still have been allowed to enter the
GSS handling code.  This was handled incorrectly when gssencmode was set
to "require".  "prefer" was working correctly, and this could not happen
under "disable" as GSS encryption would not be attempted.

This commit makes the error handling of GSS encryption on par with TLS
portion, fixing the case of gssencmode=require.

Reported-by: Jacob Champion
Author: Michael Paquier
Reviewed-by: Jacob Champion, Stephen Frost
Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4713@timescale.com
Backpatch-through: 12
src/interfaces/libpq/fe-connect.c