From 9617a7eb137f4fee62799a677a9ecf8d834db3f5 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sun, 3 Feb 2013 17:35:43 +1100 Subject: [PATCH] pppd: Arrange to use logwtmp from libutil on Linux Idea stolen from Fedora ppp patches. Signed-off-by: Paul Mackerras --- pppd/Makefile.linux | 8 ++++++++ pppd/sys-linux.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux index fd71454..a74c914 100644 --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux @@ -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) diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 2540c4f..72a7727 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -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 */ /******************************************************************** * -- 2.39.2