postgresql/src
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
..
backend Invent open_auth_file() in hba.c to refactor authentication file opening 2022-11-14 10:21:42 +09:00
bin Support writing "CREATE/ALTER TABLE ... SET STORAGE DEFAULT". 2022-11-10 18:20:49 -05:00
common Introduce pg_pwrite_zeros() in fileutils.c 2022-11-08 12:23:46 +09:00
fe_utils meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
include Invent open_auth_file() in hba.c to refactor authentication file opening 2022-11-14 10:21:42 +09:00
interfaces libpq: Add missing newlines to error messages 2022-11-13 21:09:09 +01:00
makefiles autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
pl Refactor aclcheck functions 2022-11-13 09:02:41 +01:00
port Provide sigaction() for Windows. 2022-11-09 13:06:31 +13:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Use installed postgresql.conf.sample for GUC sanity TAP test 2022-11-13 09:07:53 -05:00
timezone Remove unneeded includes of <sys/stat.h> 2022-11-05 12:31:28 +09:00
tools Suppress useless wakeups in walreceiver. 2022-11-08 20:36:36 +13:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Make finding openssl program a configure or meson option 2022-10-20 21:05:42 +02:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00