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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
Date: 2024-01-03 22:41:04
Message-ID: E1rL9v5-00DLLI-Ki@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9b042e27eb1dea6adce8d939aa658ef91d911ce2

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

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2024-01-03 23:47:52 pgsql: doc: fix typo "vertexes" -> "vertices"
Previous Message Peter Eisentraut 2024-01-03 21:01:33 Re: pgsql: Reorganise jsonpath operators and methods