Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login: warning missing pam_lastlog.so #542

Closed
troglobit opened this issue Jul 14, 2024 · 9 comments · Fixed by #551
Closed

login: warning missing pam_lastlog.so #542

troglobit opened this issue Jul 14, 2024 · 9 comments · Fixed by #551
Assignees
Labels
enhancement New feature or request upstream Kernel, Buildroot, or other upstream related

Comments

@troglobit
Copy link
Contributor

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
@mattiaswal
Copy link
Contributor

lastlog is not enabled in linux-pam in buildroot.
I think lastlog is a good thing, but --enable-lastlog needs to be added to buildroot recipe.

@troglobit
Copy link
Contributor Author

Aha, time for some upstream work then! I'll have a look :-)

@troglobit troglobit self-assigned this Aug 3, 2024
@troglobit troglobit added enhancement New feature or request upstream Kernel, Buildroot, or other upstream related labels Aug 3, 2024
@mattiaswal
Copy link
Contributor

Aha, time for some upstream work then! I'll have a look :-)

Please also upstream my patch on linux pam to fix path for .pc files when you are already on 🔥

@troglobit
Copy link
Contributor Author

troglobit commented Aug 4, 2024

Ouch, that one looks a bit nasty ... I think we should revert our change and fix rousette instead, because the Buildroot pkg-config seems to work just fine: locating the .pc files in /lib (staging).

~/src/buildroot(linux-pam-options)$ ./output/host/bin/pkg-config --cflags pam
-I./output/host/bin/../x86_64-buildroot-linux-uclibc/sysroot/usr/include/security 
~/src/buildroot(linux-pam-options)$ ./output/host/bin/pkg-config --libs pam
-L./output/host/bin/../x86_64-buildroot-linux-uclibc/sysroot/lib -lpam 

@troglobit
Copy link
Contributor Author

@mattiaswal
Copy link
Contributor

mattiaswal commented Aug 5, 2024

./output/host/bin/pkg-config --cflags pam

lazzer@tollan ~/Documents/addiva/infix (main)$ ./output/host/bin/pkg-config --cflags pam
Package pam was not found in the pkg-config search path.
Perhaps you should add the directory containing `pam.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pam', required by 'virtual:world', not found
lazzer@tollan ~/Documents/addiva/infix (main)$ 

@mattiaswal
Copy link
Contributor

mattiaswal commented Aug 5, 2024

How do find output/ -name.pc looks like?

My (relevant parts) looks like:

output/host/x86_64-buildroot-linux-gnu/sysroot/lib/pkgconfig/pamc.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/lib/pkgconfig/pam.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/lib/pkgconfig/pam_misc.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/dbus-cxx-2.0.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libtirpc.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libnetfilter_cthelper.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libnetfilter_conntrack.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libuev.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/ext2fs.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/avahi-core.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libbsd.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libpcre2-8.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libsyslog.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/glib-2.0.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/popt.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libassuan.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/sysrepo.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/libpcre2-posix.pc
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/json-c.pc
.....

@troglobit
Copy link
Contributor Author

Interesting, here's my output, notably from Buildroot (recently branched from) master:

~/src/buildroot(linux-pam-options)$ find output/staging/ -name '*.pc'
output/staging/usr/lib/pkgconfig/libcrypt.pc
output/staging/usr/lib/pkgconfig/libxcrypt.pc
output/staging/usr/lib/pkgconfig/python-3.12-embed.pc
output/staging/usr/lib/pkgconfig/fmt.pc
output/staging/usr/lib/pkgconfig/python3.pc
output/staging/usr/lib/pkgconfig/libsyslog.pc
output/staging/usr/lib/pkgconfig/zlib.pc
output/staging/usr/lib/pkgconfig/pam.pc
output/staging/usr/lib/pkgconfig/pam_misc.pc
output/staging/usr/lib/pkgconfig/python3-embed.pc
output/staging/usr/lib/pkgconfig/spdlog.pc
output/staging/usr/lib/pkgconfig/python-3.12.pc
output/staging/usr/lib/pkgconfig/pamc.pc
output/staging/usr/lib/pkgconfig/expat.pc
output/staging/usr/lib/pkgconfig/openssl.pc
output/staging/usr/lib/pkgconfig/libssl.pc
output/staging/usr/lib/pkgconfig/libffi.pc
output/staging/usr/lib/pkgconfig/libcrypto.pc

Lemme have a look around the tree.

@troglobit
Copy link
Contributor Author

Found it, root cause is:

# BR2_ROOTFS_MERGED_USR is not set

With it unset, as in Infix' defconfigs, I get the same as you:

~/src/buildroot(linux-pam-options)$ find output/staging/ -name '*.pc'
output/staging/usr/lib/pkgconfig/libcrypt.pc
output/staging/usr/lib/pkgconfig/libxcrypt.pc
output/staging/usr/lib/pkgconfig/python-3.12-embed.pc
output/staging/usr/lib/pkgconfig/python3.pc
output/staging/usr/lib/pkgconfig/libsyslog.pc
output/staging/usr/lib/pkgconfig/zlib.pc
output/staging/usr/lib/pkgconfig/python3-embed.pc
output/staging/usr/lib/pkgconfig/python-3.12.pc
output/staging/usr/lib/pkgconfig/expat.pc
output/staging/usr/lib/pkgconfig/openssl.pc
output/staging/usr/lib/pkgconfig/libssl.pc
output/staging/usr/lib/pkgconfig/libffi.pc
output/staging/usr/lib/pkgconfig/libcrypto.pc
output/staging/lib/pkgconfig/pam.pc
output/staging/lib/pkgconfig/pam_misc.pc
output/staging/lib/pkgconfig/pamc.pc

Since there's no point really in maintaining a difference beteen /bin,/sbin and /usr/bin,/usr/sbin et al on Infix, I suggest we update our defconfigs to:

BR2_ROOTFS_MERGED_USR=y

Which is the default, so dropping the line entirely would be equivalent.

troglobit added a commit that referenced this issue Aug 11, 2024
Backport pam-lastlog build fix from latest Buildroot master and enable
in all defconfigs to fix syslog warning:

   login[2819]: PAM unable to dlopen(/lib/security/pam_lastlog.so)

Fixes #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit troglobit mentioned this issue Aug 11, 2024
13 tasks
troglobit added a commit that referenced this issue Aug 12, 2024
Backport pam-lastlog build fix from latest Buildroot master and enable
in all defconfigs to fix syslog warning:

   login[2819]: PAM unable to dlopen(/lib/security/pam_lastlog.so)

Fixes #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@wkz wkz closed this as completed in #551 Aug 16, 2024
wkz pushed a commit that referenced this issue Aug 16, 2024
Backport pam-lastlog build fix from latest Buildroot master and enable
in all defconfigs to fix syslog warning:

   login[2819]: PAM unable to dlopen(/lib/security/pam_lastlog.so)

Fixes #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Aug 28, 2024
The PAM plugin lastlog, previously used (optional) by Netopeer2 and
Rousette, does not rotate /var/log/lastlog, and since we don't have
cron and logrotate this can potentially fill up /var.

This patch disables pam_lastlog.so from the build and drops the two
matching session lines for both Netopeer2 and Rousette.  Both still
log user access to sysrepo, so no critical functionality is lost.

Follow-up to issue #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Aug 28, 2024
The PAM plugin lastlog, previously used (optional) by Netopeer2 and
Rousette, does not rotate /var/log/lastlog, and since we don't have
cron and logrotate this can potentially fill up /var.

This patch disables pam_lastlog.so from the build and drops the two
matching session lines for both Netopeer2 and Rousette.  Both still
log user access to sysrepo, so no critical functionality is lost.

Follow-up to issue #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Aug 30, 2024
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 <troglobit@gmail.com>
troglobit added a commit that referenced this issue Aug 30, 2024
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 <troglobit@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream Kernel, Buildroot, or other upstream related
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants