agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix md5_password_warnings for role and database settings
Date: Thu, 11 Jun 2026 23:33:57 +0000
Message-ID: <E1wXouL-0024al-14@gemulon.postgresql.org> (raw)

Fix md5_password_warnings for role and database settings

MD5 authentication warnings are queued during authentication, before
startup options and role/database settings have been applied. The code
checked md5_password_warnings at queue time, so settings such as
ALTER ROLE ... SET md5_password_warnings = off did not suppress the
warning, even though the established session showed the GUC as off.

Keep the connection-warning infrastructure generic by allowing each
queued warning to carry an optional filter callback. Evaluate that
callback when warnings are emitted, after startup options and
role/database settings have been processed.

Use this for MD5 authentication warnings, while leaving password
expiration warnings unchanged. Add test coverage for an MD5-authenticated
role with md5_password_warnings disabled.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/AE46E42D-5966-4D76-9E64-95EAB01B9FB5@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/44196fd4f378d776c4cd7282256f4d6df03b5734

Modified Files
--------------
src/backend/libpq/crypt.c                 | 31 ++++++++++--------
src/backend/utils/init/postinit.c         | 52 ++++++++++++++++++++-----------
src/include/miscadmin.h                   |  4 ++-
src/test/authentication/t/001_password.pl | 17 ++++++++++
src/tools/pgindent/typedefs.list          |  1 +
5 files changed, 72 insertions(+), 33 deletions(-)



Message-ID: <E1wXouL-0024al-14@gemulon.postgresql.org>
Permalink:  ../E1wXouL-0024al-14@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wXouL-0024al-14@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: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix md5_password_warnings for role and database settings
  In-Reply-To: <E1wXouL-0024al-14@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox