about summary refs log tree commit diff
path: root/include/utmp.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-06-27 20:00:29 -0400
committerRich Felker <dalias@aerifal.cx>2013-06-27 20:00:29 -0400
commit1e2281b8356d1935a129ddb199d71677f19a1619 (patch)
tree8b5e757529213612235cdbb641f566fa263b9055 /include/utmp.h
parent3cd6f5229f079f892411e82fce3fe15c78eef4d8 (diff)
downloadmusl-1e2281b8356d1935a129ddb199d71677f19a1619.tar.gz
musl-1e2281b8356d1935a129ddb199d71677f19a1619.tar.xz
musl-1e2281b8356d1935a129ddb199d71677f19a1619.zip
minor compatibility fixes in utmp.h and fixing mismatch with paths.h
the pathnames prefixed with /dev/null/ are guaranteed never to be
valid. the previous use of /dev/null alone was mildly dangerous in
that bad software might attempt to unlink the name when it found a
non-regular file there and create a new file.
Diffstat (limited to 'include/utmp.h')
-rw-r--r--include/utmp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/utmp.h b/include/utmp.h
index c24d0a8d..b357ac8c 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -19,6 +19,7 @@ struct lastlog {
 
 #define ut_time ut_tv.tv_sec
 #define ut_name ut_user
+#define ut_addr ut_addr_v6[0]
 #define utmp utmpx
 #define utmpname(x) (-1)
 
@@ -31,8 +32,13 @@ void         setutent(void);
 
 void updwtmp(const char *, const struct utmp *);
 
-#define _PATH_UTMP "/dev/null"
-#define _PATH_WTMP "/dev/null"
+#define _PATH_UTMP "/dev/null/utmp"
+#define _PATH_WTMP "/dev/null/wtmp"
+
+#define UTMP_FILE _PATH_UTMP
+#define WTMP_FILE _PATH_WTMP
+#define UTMP_FILENAME _PATH_UTMP
+#define WTMP_FILENAME _PATH_WTMP
 
 #ifdef __cplusplus
 }