From: Paul Mackerras Date: Wed, 16 Aug 1995 01:37:22 +0000 (+0000) Subject: Only chop off first /dev/ from devnam before calling logwtmp. X-Git-Tag: RELEASE_2_3_6~624 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=1a2b3953feacff276850e24e6ee793ccf9c357c1;ds=sidebyside Only chop off first /dev/ from devnam before calling logwtmp. --- diff --git a/pppd/auth.c b/pppd/auth.c index 18f60f0..dd9735b 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.17 1995/08/16 01:37:22 paulus Exp $"; #endif #include @@ -507,11 +507,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 +524,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; }