pgsql: Avoid logging complaints about abandoned connections when using

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid logging complaints about abandoned connections when using
Date: 2019-11-05 19:29:36
Message-ID: E1iS4WG-0001Ks-3z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid logging complaints about abandoned connections when using PAM.

For a long time (since commit aed378e8d) we have had a policy to log
nothing about a connection if the client disconnects when challenged
for a password. This is because libpq-using clients will typically
do that, and then come back for a new connection attempt once they've
collected a password from their user, so that logging the abandoned
connection attempt will just result in log spam. However, this did
not work well for PAM authentication: the bottom-level function
pam_passwd_conv_proc() was on board with it, but we logged messages
at higher levels anyway, for lack of any reporting mechanism.
Add a flag and tweak the logic so that the case is silent, as it is
for other password-using auth mechanisms.

Per complaint from Yoann La Cancellera. It's been like this for awhile,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/CACP=ajbrFFYUrLyJBLV8=q+eNCapa1xDEyvXhMoYrNphs-xqPw@mail.gmail.com

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/libpq/auth.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2019-11-05 22:47:19 pgsql: Split all OBJS style lines in makefiles into one-line-per-entry
Previous Message Tom Lane 2019-11-05 18:40:53 pgsql: Fix "unexpected relkind" error when denying permissions on toast