utmpx is specified by POSIX as an XSI extension. That's more portable than utmp, which is unavailable for example in musl libc. The manual page specifies that in Linux (but it probably means in glibc), utmp and utmpx (and the functions that use them) are identical, so this commit shouldn't affect glibc systems. Assume utmpx is always present. Also, if utmpx is present, POSIX guarantees that some members exist: - ut_user - ut_id - ut_line - ut_pid - ut_type - ut_tv So, rely on them unconditionally. Fixes:170b76cdd1("Disable utmpx permanently") Closes: <https://github.com/shadow-maint/shadow/issues/945> Reported-by: Firas Khalil Khana <firasuke@gmail.com> Reported-by: "A. Wilfox" <https://github.com/awilfox> Tested-by: Firas Khalil Khana <firasuke@gmail.com> Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org> Cherry-picked-from:64bcb54fa9("lib/, src/, configure.ac: Use utmpx instead of utmp") Signed-off-by: Alejandro Colomar <alx@kernel.org>
2.3 KiB
2.3 KiB