Allow records to span multiple lines in pg_hba.conf and pg_ident.conf.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Sep 2020 16:16:48 +0000 (12:16 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Sep 2020 16:16:48 +0000 (12:16 -0400)
commit8f8154a503c71a18ad72c64f4aefb9d847c45b86
treef23b34ca1b45addb22a01ab969f08478bdd7d18d
parentd2511d71328cb30b0d6b3f43af4809df83c4f0cc
Allow records to span multiple lines in pg_hba.conf and pg_ident.conf.

A backslash at the end of a line now causes the next line to be appended
to the current one (effectively, the backslash and newline are discarded).
This allows long HBA entries to be created without legibility problems.

While we're here, get rid of the former hard-wired length limit on
pg_hba.conf lines, by using an expansible StringInfo buffer instead
of a fixed-size local variable.

Since the same code is used to read the ident map file, these changes
apply there as well.

Fabien Coelho, reviewed by Justin Pryzby and David Zhang

Discussion: https://postgr.es/m/alpine.DEB.2.21.2003251906140.15243@pseudo
doc/src/sgml/client-auth.sgml
src/backend/libpq/hba.c
src/test/authentication/t/001_password.pl