dslm4515 / Musl-LFS

Linux From Scratch using Musl as Libc
GNU General Public License v3.0
170 stars 21 forks source link

`/dev/null/utmp` still in use instead of `/run/utmps/utmp` #54

Closed dslm4515 closed 2 years ago

dslm4515 commented 2 years ago

When OpenSSH is running and a user connects with ssh the following warning is logged:

wtmp_write: problem writing /dev/null/wtmp: Not a directory

The correct path should be /run/utmps/utmp as defined in /usr/include/path.h. Header is provided by musl libc.

Looking at the openSSH source, looks like openSSH is setting path from /usr/include/utmp.h, which has incorrect paths:

#define _PATH_UTMP "/dev/null/utmp"
#define _PATH_WTMP "/dev/null/wtmp"

Looks like utmp.h of musl libc will need to be patched.

dslm4515 commented 2 years ago

Musl's utmp.h will need to be patched so that...

#define _PATH_UTMP "/run/utmps/utmp"
#define _PATH_WTMP "/var/log/wtmp"

To stay 'standardized' link /var/log/utmps/wtmp to /var/log/wtmp since:

Wtmp is a file on the Linux, Solaris, and BSD operating systems that keeps a history of all logins and logouts. On Linux systems, it is located at /var/log/wtmp

dslm4515 commented 2 years ago

Fixed in commit 962da5c