postgresql/src
Tom Lane c1c88bf03e Fix assorted issues in backend's GSSAPI encryption support.
Unrecoverable errors detected by GSSAPI encryption can't just be
reported with elog(ERROR) or elog(FATAL), because attempting to
send the error report to the client is likely to lead to infinite
recursion or loss of protocol sync.  Instead make this code do what
the SSL encryption code has long done, which is to just report any
such failure to the server log (with elevel COMMERROR), then pretend
we've lost the connection by returning errno = ECONNRESET.

Along the way, fix confusion about whether message translation is done
by pg_GSS_error() or its callers (the latter should do it), and make
the backend version of that function work more like the frontend
version.

Avoid allocating the port->gss struct until it's needed; we surely
don't need to allocate it in the postmaster.

Improve logging of "connection authorized" messages with GSS enabled.
(As part of this, I back-patched the code changes from dc11f31a1.)

Make BackendStatusShmemSize() account for the GSS-related space that
will be allocated by CreateSharedBackendStatus().  This omission
could possibly cause out-of-shared-memory problems with very high
max_connections settings.

Remove arbitrary, pointless restriction that only GSS authentication
can be used on a GSS-encrypted connection.

Improve documentation; notably, document the fact that libpq now
prefers GSS encryption over SSL encryption if both are possible.

Per report from Mikael Gustavsson.  Back-patch to v12 where
this code was introduced.

Discussion: https://postgr.es/m/e5b0b6ed05764324a2f3fe7acfc766d5@smhi.se
2020-12-28 17:44:17 -05:00
..
backend Fix assorted issues in backend's GSSAPI encryption support. 2020-12-28 17:44:17 -05:00
bin Avoid time-of-day-dependent failure in log rotation test. 2020-12-24 21:37:46 -05:00
common Second thoughts on TOAST decompression. 2020-11-02 11:25:18 -05:00
fe_utils Remove incorrect %s in string 2020-11-09 10:38:43 +01:00
include Fix assorted issues in backend's GSSAPI encryption support. 2020-12-28 17:44:17 -05:00
interfaces Fix bugs in libpq's GSSAPI encryption support. 2020-12-28 15:43:44 -05:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Further fix thinko in plpgsql memory leak fix. 2020-12-28 11:55:32 -05:00
port Clear some style deviations. 2020-05-21 08:31:16 -07:00
template On macOS, use -isysroot in link steps as well as compile steps. 2020-11-20 00:58:26 -05:00
test Second attempt to stabilize 05c02589. 2020-12-27 12:11:58 -08:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:24:01 -04:00
tools backpatch "jit: Add support for LLVM 12." 2020-12-07 18:32:32 -08:00
tutorial Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Update Unicode data to Unicode 13.0.0 and CLDR 37 2020-04-24 09:52:59 +02:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00