1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 03:09:51 +03:00
aports/main/util-linux/utmps.patch
Dmitry Klochkov e7067b5850 main/util-linux: return utmps.patch
Although utmps provides its own utmp definitions, it does it in the
"utmp.h" file whereas utmp related utilities use the "utmpx.h" file.  As
a result, stub utmp paths are used, for example:

  $ last
  last: cannot open /dev/null/wtmp: Not a directory

So return the "utmps.patch" to restore correct path names.

Fixes: 779eb28e59 ("main/util-linux: align pkg-config use with utmps change (now libutmps)")
2025-05-26 20:04:45 +00:00

25 lines
690 B
Diff

From: Jakub Jirutka <jakub@jirutka.cz>
Date: Mon, 20 Dec 2021 18:52:00 +0100
Subject: [PATCH] Add support for utmps
The following programs use utmpx.h: last, login, lslogins, agetty, wall, write.
Programs 'su' and 'runuser' include utmpx.h, but use only btmp which is not
supported on Alpine.
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -214,5 +214,13 @@
#define _PATH_DEV_RFKILL "/dev/rfkill"
#define _PATH_SYS_RFKILL "/sys/class/rfkill"
+#ifdef UTMPS_UTMPX_H
+/* override stub paths from <paths.h> with ones for utmps */
+# undef _PATH_UTMP
+# define _PATH_UTMP UTMPX_FILE
+# undef _PATH_WTMP
+# define _PATH_WTMP "/var/log/wtmp"
+#endif
+
#endif /* PATHNAMES_H */