summaryrefslogblamecommitdiff
path: root/user/ppp/utmpx.patch
blob: 2914bc4be1bc93b0e8fca658c2e188ce671ea694 (plain) (tree)












































































































































                                                                           
--- 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>