From cf1c4c32f16212be8d6f2b759683ca36a592de27 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 30 Aug 2024 13:47:29 +0200 Subject: [PATCH] board/common: disable unused pam_lastlog.so from PAM login Fixes the following recurring login warning in syslog. (We cannot use pam_lastlog.so since it does not rotate its /var/log/lastlog file.) login[2819]: PAM unable to dlopen(/lib/security/pam_lastlog.so): /lib/security/pam_lastlog.so: cannot open shared object file: No such file or directory Follow-up to issue #542 Signed-off-by: Joachim Wiberg --- board/common/post-build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/common/post-build.sh b/board/common/post-build.sh index 7cb5ad6d..4ac2b584 100755 --- a/board/common/post-build.sh +++ b/board/common/post-build.sh @@ -110,6 +110,9 @@ if [ -L "$TARGET_DIR/var/lib/avahi-autoipd" ]; then mkdir "$TARGET_DIR/var/lib/avahi-autoipd" fi +# Drop Buildroot default pam_lastlog.so from login chain +sed -i '/^[^#]*pam_lastlog.so/s/^/# /' "$TARGET_DIR/etc/pam.d/login" + # Allow pdmenu (setup) and bash to be login shells, bash is added # automatically when selected in menuyconfig, but not when BusyBox # provides a symlink (for ash). The /bin/{true,false} are old UNIX