postgresql/src/include
Tom Lane 622ae4621e 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
..
access Multirange datatypes 2020-12-20 07:20:33 +03:00
bootstrap Update copyrights for 2020 2020-01-01 12:21:45 -05:00
catalog Revert "Add key management system" (978f869b99) & later commits 2020-12-27 21:37:42 -05:00
commands Multirange datatypes 2020-12-20 07:20:33 +03:00
common Revert "Add key management system" (978f869b99) & later commits 2020-12-27 21:37:42 -05:00
datatype Update copyrights for 2020 2020-01-01 12:21:45 -05:00
executor Support subscripting of arbitrary types, not only arrays. 2020-12-09 12:40:37 -05:00
fe_utils Move connect.h from fe_utils to src/include/common. 2020-08-10 09:22:54 -07:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit jit: Reference function pointer types via llvmjit_types.c. 2020-12-08 16:55:20 -08:00
lib Correct comment in simplehash.h. 2020-08-03 12:23:05 +12:00
libpq Fix assorted issues in backend's GSSAPI encryption support. 2020-12-28 17:44:17 -05:00
mb Allow Unicode escapes in any server encoding, not only UTF-8. 2020-03-06 14:17:43 -05:00
nodes Support subscripting of arbitrary types, not only arrays. 2020-12-09 12:40:37 -05:00
optimizer Disallow SRFs when considering sorts below Gather Merge 2020-12-21 19:36:22 +01:00
parser Support subscripting of arbitrary types, not only arrays. 2020-12-09 12:40:37 -05:00
partitioning Improve error cursor positions for problems with partition bounds. 2020-09-23 18:04:53 -04:00
port Use https for gnu.org links 2020-10-14 08:24:54 +02:00
portability Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postmaster Revert "Add key management system" (978f869b99) & later commits 2020-12-27 21:37:42 -05:00
regex Assume that we have <wchar.h>. 2020-02-21 14:30:47 -05:00
replication Move SHA2 routines to a new generic API layer for crypto hashes 2020-12-02 10:37:20 +09:00
rewrite Calculate extraUpdatedCols in query rewriter, not parser. 2020-10-28 13:47:02 -04:00
snowball Update snowball 2020-06-08 08:07:15 +02:00
statistics Improve estimation of OR clauses using extended statistics. 2020-12-03 10:03:49 +00:00
storage Improve client error messages for immediate-stop situations. 2020-12-24 12:58:32 -05:00
tcop Fix bogus completion tag usage in walsender 2020-09-16 21:16:25 -03:00
tsearch Improve behavior of tsearch_readline(), and remove t_readline(). 2020-09-23 20:26:58 -04:00
utils Revert "Add key management system" (978f869b99) & later commits 2020-12-27 21:37:42 -05:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
c.h Support subscripting of arbitrary types, not only arrays. 2020-12-09 12:40:37 -05:00
fmgr.h Use PG_GETARG_TRANSACTIONID where appropriate 2020-11-02 16:48:22 +01:00
funcapi.h Support for OUT parameters in procedures 2020-10-05 09:21:43 +02:00
getaddrinfo.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
getopt_long.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
miscadmin.h Add hash_mem_multiplier GUC. 2020-07-29 14:14:58 -07:00
pg_config.h.in Remove ability to independently select random number generator 2020-11-20 13:57:33 +01:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Add nbtree Valgrind buffer lock checks. 2020-07-21 15:50:58 -07:00
pg_getopt.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_trace.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgstat.h Revert "Add key management system" (978f869b99) & later commits 2020-12-27 21:37:42 -05:00
pgtar.h Assorted cleanup of tar-related code. 2020-06-15 15:28:49 -04:00
pgtime.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
port.h Add pg_strong_random_init function to initialize random number generator 2020-11-06 13:21:28 +01:00
postgres.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
rusagestub.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
windowapi.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00