Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/linux-pam: adjust login pam file for lastlog
@ 2024-10-01  9:20 Michael Nosthoff via buildroot
  2024-10-29 21:35 ` Thomas Petazzoni via buildroot
  2024-11-20 20:45 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Nosthoff via buildroot @ 2024-10-01  9:20 UTC (permalink / raw)
  To: buildroot

when pam_lastlog.so is not installed login issues an error
that it is not able to load it.

Hence only enable the entry when pam_lastlog.so is installed.

Fixes:
 login[649]: PAM unable to dlopen(/lib/security/pam_lastlog.so): /lib/security/pam_lastlog.so: cannot open shared object file: No such file or directory
 login[649]: PAM adding faulty module: /lib/security/pam_lastlog.so

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
---
 package/linux-pam/linux-pam.mk | 5 +++++
 package/linux-pam/login.pam    | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/linux-pam/linux-pam.mk b/package/linux-pam/linux-pam.mk
index 1433eb00b3..c5543e1f1f 100644
--- a/package/linux-pam/linux-pam.mk
+++ b/package/linux-pam/linux-pam.mk
@@ -56,6 +56,10 @@ endif
 
 ifeq ($(BR2_PACKAGE_LINUX_PAM_LASTLOG),y)
 LINUX_PAM_CONF_OPTS += --enable-lastlog
+define LINUX_PAM_LASTLOG_PAMFILE_TWEAK
+	$(SED) 's/^# \(.*pam_lastlog.so.*\)$$/\1/' \
+		$(TARGET_DIR)/etc/pam.d/login
+endef
 else
 LINUX_PAM_CONF_OPTS += --disable-lastlog
 endif
@@ -66,6 +70,7 @@ define LINUX_PAM_INSTALL_CONFIG
 		$(TARGET_DIR)/etc/pam.d/login
 	$(INSTALL) -m 0644 -D package/linux-pam/other.pam \
 		$(TARGET_DIR)/etc/pam.d/other
+	$(LINUX_PAM_LASTLOG_PAMFILE_TWEAK)
 	$(LINUX_PAM_SELINUX_PAMFILE_TWEAK)
 endef
 
diff --git a/package/linux-pam/login.pam b/package/linux-pam/login.pam
index 5df7db628c..21d2afb61e 100644
--- a/package/linux-pam/login.pam
+++ b/package/linux-pam/login.pam
@@ -8,5 +8,5 @@ password	required	pam_unix.so nullok
 session		required	pam_limits.so
 session		required	pam_env.so
 session		required	pam_unix.so
-session		optional	pam_lastlog.so
+# session	optional	pam_lastlog.so
 # session	required	pam_selinux.so open
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-11-20 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01  9:20 [Buildroot] [PATCH] package/linux-pam: adjust login pam file for lastlog Michael Nosthoff via buildroot
2024-10-29 21:35 ` Thomas Petazzoni via buildroot
2024-11-20 20:45 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox