Fix GSS client to non-GSS server connection
authorStephen Frost <sfrost@snowman.net>
Sat, 2 May 2020 15:39:32 +0000 (11:39 -0400)
committerStephen Frost <sfrost@snowman.net>
Sat, 2 May 2020 15:39:32 +0000 (11:39 -0400)
commit79e594cf04754d55196d2ce54fc869ccad5fa9c3
tree49af0fa266b05cd1a78f7b9f7acbf9a9c3ca211b
parentc08da32f133b0fea794d7cf346bfa73021366d3a
Fix GSS client to non-GSS server connection

If the client is compiled with GSSAPI support and tries to start up GSS
with the server, but the server is not compiled with GSSAPI support, we
would mistakenly end up falling through to call ProcessStartupPacket
with secure_done = true, but the client might then try to perform SSL,
which the backend wouldn't understand and we'd end up failing the
connection with:

FATAL:  unsupported frontend protocol 1234.5679: server supports 2.0 to 3.0

Fix by arranging to track ssl_done independently from gss_done, instead
of trying to use the same boolean for both.

Author: Andrew Gierth
Discussion: https://postgr.es/m/87h82kzwqn.fsf@news-spur.riddles.org.uk
Backpatch: 12-, where GSSAPI encryption was added.
src/backend/postmaster/postmaster.c