]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix build breakage on Solaris-alikes with late-model GCC.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Jul 2025 19:44:29 +0000 (15:44 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Jul 2025 19:44:29 +0000 (15:44 -0400)
commit1ccb3851db5d29d6d6bd02f53c7e2020107ff73b
tree0e825f5a4a9350d664b4b95dd766f3caef0376b1
parentc934d56738946fe50a413e13301d60c7a3c7318c
Fix build breakage on Solaris-alikes with late-model GCC.

Solaris has never bothered to add "const" to the second argument
of PAM conversation procs, as all other Unixen did decades ago.
This resulted in an "incompatible pointer" compiler warning when
building --with-pam, but had no more serious effect than that,
so we never did anything about it.  However, as of GCC 14 the
case is an error not warning by default.

To complicate matters, recent OpenIndiana (and maybe illumos
in general?) *does* supply the "const" by default, so we can't
just assume that platforms using our solaris template need help.

What we can do, short of building a configure-time probe,
is to make solaris.h #define _PAM_LEGACY_NONCONST, which
causes OpenIndiana's pam_appl.h to revert to the traditional
definition, and hopefully will have no effect anywhere else.
Then we can use that same symbol to control whether we include
"const" in the declaration of pam_passwd_conv_proc().

Bug: #18995
Reported-by: Andrew Watkins <awatkins1966@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/18995-82058da9ab4337a7@postgresql.org
Backpatch-through: 13
src/backend/libpq/auth.c
src/include/port/solaris.h