summaryrefslogtreecommitdiff
path: root/user/ppp/utmpx.patch
blob: 2914bc4be1bc93b0e8fca658c2e188ce671ea694 (plain) (blame)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
--- ppp-2.4.7/pppd/utils.c.old	2014-08-09 12:31:39.000000000 +0000
+++ ppp-2.4.7/pppd/utils.c	2019-05-09 22:13:47.546342436 +0000
@@ -41,7 +41,7 @@
 #include <syslog.h>
 #include <netdb.h>
 #include <time.h>
-#include <utmp.h>
+#include <utmpx.h>
 #include <pwd.h>
 #include <sys/param.h>
 #include <sys/types.h>
--- ppp-2.4.7/pppd/auth.c.old	2019-05-09 22:07:26.737835517 +0000
+++ ppp-2.4.7/pppd/auth.c	2019-05-09 22:14:11.833696617 +0000
@@ -81,7 +81,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
-#include <utmp.h>
+#include <utmpx.h>
 #include <fcntl.h>
 #if defined(_PATH_LASTLOG) && defined(__linux__)
 #include <lastlog.h>
--- ppp-2.4.7/pppd/sys-linux.c.old	2019-05-09 22:07:26.747834427 +0000
+++ ppp-2.4.7/pppd/sys-linux.c	2019-05-09 22:15:20.616203578 +0000
@@ -85,7 +85,7 @@
 #include <string.h>
 #include <time.h>
 #include <memory.h>
-#include <utmp.h>
+#include <utmpx.h>
 #include <mntent.h>
 #include <signal.h>
 #include <fcntl.h>
@@ -2230,75 +2230,6 @@
  * Update the wtmp file with the appropriate user name and tty device.
  */
 
-void logwtmp (const char *line, const char *name, const char *host)
-{
-    struct utmp ut, *utp;
-    pid_t  mypid = getpid();
-#if __GLIBC__ < 2
-    int    wtmp;
-#endif
-
-/*
- * Update the signon database for users.
- * Christoph Lameter: Copied from poeigl-1.36 Jan 3, 1996
- */
-    utmpname(_PATH_UTMP);
-    setutent();
-    while ((utp = getutent()) && (utp->ut_pid != mypid))
-	/* nothing */;
-
-    if (utp)
-	memcpy(&ut, utp, sizeof(ut));
-    else
-	/* some gettys/telnetds don't initialize utmp... */
-	memset(&ut, 0, sizeof(ut));
-
-    if (ut.ut_id[0] == 0)
-	strncpy(ut.ut_id, line + 3, sizeof(ut.ut_id));
-
-    strncpy(ut.ut_user, name, sizeof(ut.ut_user));
-    strncpy(ut.ut_line, line, sizeof(ut.ut_line));
-
-    time(&ut.ut_time);
-
-    ut.ut_type = USER_PROCESS;
-    ut.ut_pid  = mypid;
-
-    /* Insert the host name if one is supplied */
-    if (*host)
-	strncpy (ut.ut_host, host, sizeof(ut.ut_host));
-
-    /* Insert the IP address of the remote system if IP is enabled */
-    if (ipcp_protent.enabled_flag && ipcp_hisoptions[0].neg_addr)
-	memcpy(&ut.ut_addr, (char *) &ipcp_hisoptions[0].hisaddr,
-		 sizeof(ut.ut_addr));
-
-    /* CL: Makes sure that the logout works */
-    if (*host == 0 && *name==0)
-	ut.ut_host[0]=0;
-
-    pututline(&ut);
-    endutent();
-/*
- * Update the wtmp file.
- */
-#if __GLIBC__ >= 2
-    updwtmp(_PATH_WTMP, &ut);
-#else
-    wtmp = open(_PATH_WTMP, O_APPEND|O_WRONLY);
-    if (wtmp >= 0) {
-	flock(wtmp, LOCK_EX);
-
-	if (write (wtmp, (char *)&ut, sizeof(ut)) != sizeof(ut))
-	    warn("error writing %s: %m", _PATH_WTMP);
-
-	flock(wtmp, LOCK_UN);
-
-	close (wtmp);
-    }
-#endif
-}
-
 
 /********************************************************************
  *
--- ppp-2.4.7/pppd/tty.c.old	2014-08-09 12:31:39.000000000 +0000
+++ ppp-2.4.7/pppd/tty.c	2019-05-09 22:15:34.854652468 +0000
@@ -81,7 +81,7 @@
 #include <fcntl.h>
 #include <syslog.h>
 #include <netdb.h>
-#include <utmp.h>
+#include <utmpx.h>
 #include <pwd.h>
 #include <setjmp.h>
 #include <sys/param.h>
--- ppp-2.4.7/pppd/session.c.old	2014-08-09 12:31:39.000000000 +0000
+++ ppp-2.4.7/pppd/session.c	2019-05-09 22:15:52.692709222 +0000
@@ -77,7 +77,7 @@
 #include <shadow.h>
 #endif
 #include <time.h>
-#include <utmp.h>
+#include <utmpx.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include "pppd.h"
--- ppp-2.4.7/pppd/main.c.old	2019-05-09 22:07:26.717837696 +0000
+++ ppp-2.4.7/pppd/main.c	2019-05-09 22:16:06.881163559 +0000
@@ -78,7 +78,7 @@
 #include <fcntl.h>
 #include <syslog.h>
 #include <netdb.h>
-#include <utmp.h>
+#include <utmpx.h>
 #include <pwd.h>
 #include <setjmp.h>
 #include <sys/param.h>