pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
Date: Wed, 03 Jan 2024 22:41:04 +0000
Message-ID: <E1rL9v5-00DLLB-Io@gemulon.postgresql.org> (raw)

Avoid masking EOF (no-password-supplied) conditions in auth.c.

CheckPWChallengeAuth() would return STATUS_ERROR if the user does not
exist or has no password assigned, even if the client disconnected
without responding to the password challenge (as libpq often will,
for example).  We should return STATUS_EOF in that case, and the
lower-level functions do, but this code level got it wrong since the
refactoring done in 7ac955b34.  This breaks the intent of not logging
anything for EOF cases (cf. comments in auth_failed()) and might
also confuse users of ClientAuthentication_hook.

Per report from Liu Lang.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/b725238c-539d-cb09-2bff-b5e6cb2c069c@esgyn.cn

Branch
------
master

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

Modified Files
--------------
src/backend/libpq/auth.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1rL9v5-00DLLB-Io@gemulon.postgresql.org>
Permalink:  ../E1rL9v5-00DLLB-Io@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rL9v5-00DLLB-Io@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
  In-Reply-To: <E1rL9v5-00DLLB-Io@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