X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fauth.c;h=aca60b51974f9f85f4eec64279d08128c6b27917;hp=18f60f0197c850dd4eb245d38f83052cc83ab745;hb=f496bf27c6f959825eb6b6d60e31801ff6137462;hpb=728fd83b1728a00b690379006da00a966da1c4fe diff --git a/pppd/auth.c b/pppd/auth.c index 18f60f0..aca60b5 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: auth.c,v 1.16 1995/07/04 12:34:17 paulus Exp $"; +static char rcsid[] = "$Id: auth.c,v 1.18 1995/10/27 03:39:53 paulus Exp $"; #endif #include @@ -96,8 +96,7 @@ static struct wordlist *addresses[NUM_PPP]; #define CHAP_WITHPEER 4 #define CHAP_PEER 8 -/* Prototypes */ -void check_access __P((FILE *, char *)); +/* Prototypes for procedures local to this file. */ static void network_phase __P((int)); static int login __P((char *, char *, char **, int *)); @@ -507,11 +506,9 @@ login(user, passwd, msg, msglen) /* * Write a wtmp entry for this user. */ - tty = strrchr(devnam, '/'); - if (tty == NULL) - tty = devnam; - else - tty++; + tty = devnam; + if (strncmp(tty, "/dev/", 5) == 0) + tty += 5; logwtmp(tty, user, ""); /* Add wtmp login entry */ logged_in = TRUE; @@ -526,11 +523,9 @@ logout() { char *tty; - tty = strrchr(devnam, '/'); - if (tty == NULL) - tty = devnam; - else - tty++; + tty = devnam; + if (strncmp(tty, "/dev/", 5) == 0) + tty += 5; logwtmp(tty, "", ""); /* Wipe out wtmp logout entry */ logged_in = FALSE; }