]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/auth.c
Added -vjccid and vj-max-slots options, and reorganized in
[ppp.git] / pppd / auth.c
index 7d80cb07a0a960fe5284a73bc7e0eb8e0107688e..dd9735b89efdf4243b9e133e47517c8cb483de25 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 #ifndef lint
  */
 
 #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.17 1995/08/16 01:37:22 paulus Exp $";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -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"
 
 #include "ccp.h"
 #include "pathnames.h"
 
-#ifdef sparc
+#if defined(sun) && defined(sparc)
 #include <alloca.h>
 #endif /*sparc*/
 
 #include <alloca.h>
 #endif /*sparc*/
 
@@ -507,11 +507,9 @@ login(user, passwd, msg, msglen)
     /*
      * Write a wtmp entry for this user.
      */
     /*
      * 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;
 
     logwtmp(tty, user, "");            /* Add wtmp login entry */
     logged_in = TRUE;
 
@@ -526,11 +524,9 @@ logout()
 {
     char *tty;
 
 {
     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;
 }
     logwtmp(tty, "", "");              /* Wipe out wtmp logout entry */
     logged_in = FALSE;
 }