]> git.ipfire.org Git - thirdparty/util-linux.git/commit
pam_lastlog2: fix libpam linking in autotools build
authorKarel Zak <kzak@redhat.com>
Tue, 19 May 2026 08:54:57 +0000 (10:54 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 19 May 2026 08:54:57 +0000 (10:54 +0200)
commit5683ed6320e00205146cbb3d0c76462733530eca
tree590c3dca5026bca51f93fb661d22a1d01480c3ca
parente2687bcc0fcf412e5fa2424e3a4348c052e8684c
pam_lastlog2: fix libpam linking in autotools build

Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it
appears on the linker command line before object files, so the
--as-needed linker flag (default on Fedora) discards it before
seeing any undefined PAM symbols. This results in pam_lastlog2.so
missing libpam.so in its ELF NEEDED entries.

The module then fails to load with dlopen() if the calling process
does not itself link against libpam (e.g., systemd in Fedora 44+):

  PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457
Signed-off-by: Karel Zak <kzak@redhat.com>
pam_lastlog2/src/Makemodule.am