pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
@ 2024-01-03 22:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-01-03 22:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_12_STABLE

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

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



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

* pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
@ 2024-01-03 22:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-01-03 22:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



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

* pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
@ 2024-01-03 22:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-01-03 22:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_16_STABLE

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

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



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

* pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
@ 2024-01-03 22:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-01-03 22:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5810888c56d013d0627783e6404bd81027a6341d

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



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

* pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
@ 2024-01-03 22:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-01-03 22:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_15_STABLE

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

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



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

* pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c.
@ 2024-01-03 22:41  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-01-03 22:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



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


end of thread, other threads:[~2024-01-03 22:41 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 22:41 pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c. Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 22:41 pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c. Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 22:41 pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c. Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 22:41 pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c. Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 22:41 pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.c. Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 22:41 pgsql: Avoid masking EOF (no-password-supplied) conditions in auth.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