pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Eliminate fixed token-length limit in hba.c.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Eliminate fixed token-length limit in hba.c.
@ 2023-07-27 16:08  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2023-07-27 16:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Eliminate fixed token-length limit in hba.c.

Historically, hba.c limited tokens in the authentication configuration
files (pg_hba.conf and pg_ident.conf) to less than 256 bytes.  We have
seen a few reports of this limit causing problems; notably, for
moderately-complex LDAP configurations.  Let's get rid of the fixed
limit by using a StringInfo instead of a fixed-size buffer.
This actually takes less code than before, since we can get rid of
a nontrivial error recovery stanza.  It's doubtless a hair slower,
but parsing the content of the HBA files should in no way be
performance-critical.

Although this is a pretty straightforward patch, it doesn't seem
worth the risk to back-patch given the small number of complaints
to date.  In released branches, we'll just raise MAX_TOKEN to
ameliorate the problem.

Discussion: https://postgr.es/m/1588937.1690221208@sss.pgh.pa.us

Branch
------
REL_16_STABLE

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

Modified Files
--------------
src/backend/libpq/hba.c | 74 +++++++++++++++++--------------------------------
1 file changed, 26 insertions(+), 48 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Eliminate fixed token-length limit in hba.c.
@ 2023-07-27 16:08  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2023-07-27 16:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Eliminate fixed token-length limit in hba.c.

Historically, hba.c limited tokens in the authentication configuration
files (pg_hba.conf and pg_ident.conf) to less than 256 bytes.  We have
seen a few reports of this limit causing problems; notably, for
moderately-complex LDAP configurations.  Let's get rid of the fixed
limit by using a StringInfo instead of a fixed-size buffer.
This actually takes less code than before, since we can get rid of
a nontrivial error recovery stanza.  It's doubtless a hair slower,
but parsing the content of the HBA files should in no way be
performance-critical.

Although this is a pretty straightforward patch, it doesn't seem
worth the risk to back-patch given the small number of complaints
to date.  In released branches, we'll just raise MAX_TOKEN to
ameliorate the problem.

Discussion: https://postgr.es/m/1588937.1690221208@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38df84c65ea4aa9110cbc797d07225fb0fac44f7

Modified Files
--------------
src/backend/libpq/hba.c | 74 +++++++++++++++++--------------------------------
1 file changed, 26 insertions(+), 48 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-07-27 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 16:08 pgsql: Eliminate fixed token-length limit in hba.c. Tom Lane <tgl@sss.pgh.pa.us>
2023-07-27 16:08 pgsql: Eliminate fixed token-length limit in hba.c. Tom Lane <tgl@sss.pgh.pa.us>

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