Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
musl: restore normal utmp & wtmp paths
Musl does not implement utmp/wtmp functionality (see musl FAQ). utmp and wtmp file paths defined by musl point to /dev/null. This patch restores their normal paths. TLDR: Dropbear can't write utmp due to a bug, but writing to wtmp is fixed by this patch. Busybox "last" applet is fixed by this patch, but only shows logins from Dropbear. Busybox "w", "who" and "users" applets won't work and can't be fixed. Long explanation: - Dropbear can write utmp and wtmp in one of these ways, configured at build time: - login() and logout() - they do not exist in musl. - pututline() - it's a stub in musl - it won't record anything. - using it's own implementation for utmp, but it depends on ttyslot(), which is also missing in musl and build fails. IMO, this is a Dropbear bug. - using it's own implementation for wtmp which uses paths defined by musl. If the paths are repaired by this patch, wtmp recording works. - Busybox uses getutent() / pututline() from libc to read/write utmp. In musl, these functions are stubs, so Busybox won't write or read utmp. - Busybox uses updwtmp() form libc to write to wtmp. In musl, this function is also a stub, so Busybox won't write wtmp. - Busybox uses it's own implementation to read wtmp, which is used in "last" applet. It uses the file paths defined by musl. If the paths are repaired, "last" applet actually shows wtmp records (written by Dropbear). - As a result: - "getty", "login" and telnet server applets won't record logins. - "w", "who", "users" applets will always output nothing, even if Dropbear is fixed. - "last" applet is fixed by this patch and can output logins recorded by Dropbear. Signed-off-by: Marius Dinu <[email protected]>
- Loading branch information