postgresql/src/include
Michael Paquier fc579e11c6 Refactor regular expression handling in hba.c
AuthToken gains a regular expression, and IdentLine is changed so as it
uses an AuthToken rather than tracking separately the ident user string
used for the regex compilation and its generated regex_t.  In the case
of pg_ident.conf, a set of AuthTokens is built in the pre-parsing phase
of the file, and an extra regular expression is compiled when building
the list of IdentLines, after checking the sanity of the fields in a
pre-parsed entry.

The logic in charge of computing and executing regular expressions is
now done in a new set of routines called respectively
regcomp_auth_token() and regexec_auth_token() that are wrappers around
pg_regcomp() and pg_regexec(), working on AuthTokens.  While on it, this
patch adds a routine able to free an AuthToken, free_auth_token(), to
simplify a bit the logic around the requirement of using a specific free
routine for computed regular expressions.  Note that there are no
functional or behavior changes introduced by this commit.

The goal of this patch is to ease the use of regular expressions with
more items of pg_hba.conf (user list, database list, potentially
hostnames) where AuthTokens are used extensively.  This will be tackled
later in a separate patch.

Author: Bertrand Drouvot, Michael Paquier
Discussion: https://postgr.es/m/fff0d7c1-8ad4-76a1-9db3-0ab6ec338bf7@amazon.com
2022-10-19 10:08:49 +09:00
..
access Reduce xlog.h inclusion footprint 2022-10-12 09:47:11 +02:00
backup Reduce basebackup_sink.h inclusion footprint 2022-10-12 09:42:20 +02:00
bootstrap Harmonize more lexer function parameter names. 2022-09-22 13:27:16 -07:00
catalog Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
commands Allow batch insertion during COPY into a foreign table. 2022-10-13 18:45:00 +09:00
common Mark sigint_interrupt_enabled as sig_atomic_t 2022-09-29 14:28:13 +09:00
datatype Fix overflow hazards in interval input and output conversions. 2022-04-02 16:12:29 -04:00
executor Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
fe_utils Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
foreign Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
jit Add central declarations for dlsym()ed symbols 2022-07-17 17:23:42 -07:00
lib Rename shadowed local variables 2022-10-05 21:01:41 +13:00
libpq Refactor regular expression handling in hba.c 2022-10-19 10:08:49 +09:00
mb Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
nodes Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
optimizer Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
parser Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
partitioning Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
pch meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
port mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc 2022-09-30 10:50:05 -07:00
portability Fix obsolete comments in instr_time.h. 2022-08-09 11:50:03 +12:00
postmaster Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
regex Consistently use named parameters in regex code. 2022-09-19 15:10:24 -07:00
replication Add a common function to generate the origin name. 2022-10-11 10:37:52 +05:30
rewrite Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
snowball Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
statistics Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
storage Fix some comments in proc.h 2022-10-15 12:22:29 +09:00
tcop Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
tsearch Introduce t_isalnum() to replace t_isalpha() || t_isdigit() tests. 2022-10-06 11:08:56 -04:00
utils Add auxiliary lists to GUC data structures for better performance. 2022-10-14 12:36:14 -04:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Remove Abs() 2022-10-12 06:53:47 +02:00
fmgr.h Mark all symbols exported from extension libraries PGDLLEXPORT. 2022-07-17 18:50:14 -07:00
funcapi.h Remove compatibility declarations for InitMaterializedSRF() 2022-10-18 10:44:02 +09:00
getopt_long.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
Makefile Move gramparse.h to src/backend/parser 2022-09-14 10:57:13 +07:00
meson.build meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
miscadmin.h Introduce SYSTEM_USER 2022-09-29 15:05:40 +09:00
pg_config.h.in Remove configure probe for sockaddr_in6 and require AF_INET6. 2022-08-26 10:18:30 +12: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_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Remove our artificial PG_SOMAXCONN limit on listen queue length. 2022-08-23 10:15:06 -04:00
pg_getopt.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pg_trace.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgstat.h pgstat: Track time of the last scan of a relation 2022-10-14 11:11:34 -07:00
pgtar.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgtime.h Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
port.h Restore pg_pread and friends. 2022-09-29 13:12:11 +13:00
postgres.h Simplify our Assert infrastructure a little. 2022-10-10 15:16:56 -04:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
windowapi.h Update copyright for 2022 2022-01-07 19:04:57 -05:00