]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Arrange to use logwtmp from libutil on Linux
authorPaul Mackerras <paulus@samba.org>
Sun, 3 Feb 2013 06:35:43 +0000 (17:35 +1100)
committerPaul Mackerras <paulus@samba.org>
Sun, 3 Feb 2013 06:35:43 +0000 (17:35 +1100)
Idea stolen from Fedora ppp patches.

Signed-off-by: Paul Mackerras <paulus@samba.org>
pppd/Makefile.linux
pppd/sys-linux.c

index fd71454517e7ec7be2a29aa7fb3b3cdcddb9d25c..a74c914fd3acf84dbcaac360e6f5cabd3582f802 100644 (file)
@@ -73,6 +73,9 @@ PLUGIN=y
 # Enable EAP SRP-SHA1 authentication (requires libsrp)
 #USE_SRP=y
 
+# Use libutil
+USE_LIBUTIL=y
+
 MAXOCTETS=y
 
 INCLUDE_DIRS= -I../include
@@ -122,6 +125,11 @@ CFLAGS  += -DHAVE_CRYPT_H=1
 LIBS   += -lcrypt
 endif
 
+ifdef USE_LIBUTIL
+CFLAGS += -DHAVE_LOGWTMP=1
+LIBS   += -lutil
+endif
+
 ifdef NEEDDES
 ifndef USE_CRYPT
 LIBS     += -ldes $(LIBS)
index 2540c4fba29e38ce72120c4d316f369916e421c6..72a7727c403f79762a93bf1342e3b02aa869c27a 100644 (file)
@@ -2147,6 +2147,7 @@ int ppp_available(void)
     return ok;
 }
 
+#ifndef HAVE_LOGWTMP
 /********************************************************************
  *
  * Update the wtmp file with the appropriate user name and tty device.
@@ -2220,7 +2221,7 @@ void logwtmp (const char *line, const char *name, const char *host)
     }
 #endif
 }
-
+#endif /* HAVE_LOGWTMP */
 
 /********************************************************************
  *