1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
--- sysklogd-1.5.1/syslogd.c.old 2018-06-23 20:53:59.451604474 -0500
+++ sysklogd-1.5.1/syslogd.c 2018-06-23 20:58:06.251360126 -0500
@@ -494,6 +494,9 @@
* Wed Jul 4 21:02:22 CEST 2007: Martin Schulze <joey@infodrom.org>
* Open a pipe with O_NOCTTY to avoid them becoming the controlling
* tty and normal files with O_NONBLOCK to avoid blocking.
+ *
+ * Sat Jun 23 20:54:48 CDT 2018: A. Wilcox <awilfox@adelielinux.org>
+ * Use POSIX <utmpx.h> instead of non-standard <utmp.h>.
*/
@@ -511,7 +514,7 @@
#ifdef SYSV
#include <sys/types.h>
#endif
-#include <utmp.h>
+#include <utmpx.h>
#include <ctype.h>
#include <string.h>
#include <setjmp.h>
@@ -557,18 +560,6 @@
#include <paths.h>
#endif
-#ifndef UTMP_FILE
-#ifdef UTMP_FILENAME
-#define UTMP_FILE UTMP_FILENAME
-#else
-#ifdef _PATH_UTMP
-#define UTMP_FILE _PATH_UTMP
-#else
-#define UTMP_FILE "/etc/utmp"
-#endif
-#endif
-#endif
-
#ifndef _PATH_LOGCONF
#define _PATH_LOGCONF "/etc/syslog.conf"
#endif
@@ -2036,8 +2027,8 @@
register int i;
int ttyf, len;
static int reenter = 0;
- struct utmp ut;
- struct utmp *uptr;
+ struct utmpx ut;
+ struct utmpx *uptr;
char greetings[200];
(void) &len;
@@ -2046,7 +2037,7 @@
return;
/* open the user login file */
- setutent();
+ setutxent();
/*
@@ -2066,7 +2057,7 @@
len = strlen(greetings);
/* scan the user login file */
- while ((uptr = getutent())) {
+ while ((uptr = getutxent())) {
memcpy(&ut, uptr, sizeof(ut));
/* is this slot used? */
if (ut.ut_name[0] == '\0')
@@ -2120,7 +2111,7 @@
exit(0);
}
/* close the user login file */
- endutent();
+ endutxent();
reenter = 0;
}
|