postgresql/src/include/libpq
Michael Paquier 783e8c69cb Invent open_auth_file() in hba.c to refactor authentication file opening
This adds a check on the recursion depth when including authentication
configuration files, something that has never been done when processing
'@' files for database and user name lists in pg_hba.conf.  On HEAD,
this was leading to a rather confusing error, as of:
FATAL:  exceeded maxAllocatedDescs (NN) while trying to open file "/path/blah.conf"

This refactors the code so as the error reported is now the following,
which is the same as for GUCs:
FATAL: could not open file "/path/blah.conf": maximum nesting depth exceeded

This reduces a bit the verbosity of the error message used for files
included in user and database lists, reporting only the file name of
what's failing to load, without mentioning the relative or absolute path
specified after '@' in a HBA file.  The absolute path is built upon what
'@' defines anyway, so there is no actual loss of information.  This
makes the future inclusion logic much simpler.  A follow-up patch will
add an error context to be able to track on which line of which file the
inclusion is failing, to close the loop, providing all the information
needed to know the full chain of events.

This logic has been extracted from a larger patch written by Julien,
rewritten by me to have a unique code path calling AllocateFile() on
authentication files, and is useful on its own.  This new interface
will be used later for authentication files included with
@include[_dir,_if_exists], in a follow-up patch.

Author: Michael Paquier, Julien Rouhaud
Discussion: https://www.postgresql.org/message-id/Y2xUBJ+S+Z0zbxRW@paquier.xyz
2022-11-14 10:21:42 +09:00
..
auth.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
be-fsstubs.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
be-gssapi-common.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
crypt.h Improve error handling of cryptohash computations 2022-01-11 09:55:16 +09:00
hba.h Invent open_auth_file() in hba.c to refactor authentication file opening 2022-11-14 10:21:42 +09:00
ifaddr.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
libpq-be.h Allow parallel workers to retrieve some data from Port 2022-08-24 12:57:13 +09:00
libpq-fs.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
libpq.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pqcomm.h Remove configure probes for sockaddr_storage members. 2022-08-22 17:50:30 +12:00
pqformat.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pqmq.h Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
pqsignal.h Provide sigaction() for Windows. 2022-11-09 13:06:31 +13:00
sasl.h Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
scram.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00