X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fauth.c;h=aca60b51974f9f85f4eec64279d08128c6b27917;hp=7d80cb07a0a960fe5284a73bc7e0eb8e0107688e;hb=65445bac89a82ee68c6d66ab1afc271e56543f12;hpb=7ff1691466ad589562e84516e29a4a83bab71e1f diff --git a/pppd/auth.c b/pppd/auth.c index 7d80cb0..aca60b5 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: auth.c,v 1.14 1995/04/26 06:46:22 paulus Exp $"; +static char rcsid[] = "$Id: auth.c,v 1.18 1995/10/27 03:39:53 paulus Exp $"; #endif #include @@ -66,7 +66,7 @@ static char rcsid[] = "$Id: auth.c,v 1.14 1995/04/26 06:46:22 paulus Exp $"; #include "ccp.h" #include "pathnames.h" -#ifdef sparc +#if defined(sun) && defined(sparc) #include #endif /*sparc*/ @@ -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; }