pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor code related to pg_hba_file_rules() into new file
Date: Thu, 24 Mar 2022 03:43:10 +0000
Message-ID: <E1nXENR-0017FE-9N@gemulon.postgresql.org> (raw)

Refactor code related to pg_hba_file_rules() into new file

hba.c is growing big, and more contents are planned for it.  In order to
prepare for this future work, this commit moves all the code related to
the system function processing the contents of pg_hba.conf,
pg_hba_file_rules() to a new file called hbafuncs.c, which will be used
as the location for the SQL portion of the authentication file parsing.
While on it, HbaToken, the structure holding a string token lexed from a
configuration file related to authentication, is renamed to a more
generic AuthToken, as it gets used not only for pg_hba.conf, but also
for pg_ident.conf.  TokenizedLine is now named TokenizedAuthLine.

The size of hba.c is reduced by ~12%.

Author: Julien Rouhaud
Reviewed-by: Aleksander Alekseev, Michael Paquier
Discussion: https://postgr.es/m/20220223045959.35ipdsvbxcstrhya@jrouhaud

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d4781d8873f8c3fc8b0957cc03ce91627576cf36

Modified Files
--------------
src/backend/libpq/hba.c          | 517 ++++-----------------------------------
src/backend/utils/adt/Makefile   |   1 +
src/backend/utils/adt/hbafuncs.c | 428 ++++++++++++++++++++++++++++++++
src/include/libpq/hba.h          |  31 +++
src/tools/pgindent/typedefs.list |   4 +-
5 files changed, 511 insertions(+), 470 deletions(-)



Message-ID: <E1nXENR-0017FE-9N@gemulon.postgresql.org>
Permalink:  ../E1nXENR-0017FE-9N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nXENR-0017FE-9N@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Refactor code related to pg_hba_file_rules() into new file
  In-Reply-To: <E1nXENR-0017FE-9N@gemulon.postgresql.org>
  References: <E1nXENR-0017FE-9N@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox