]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/auth.c
__linux__ (already defined by compiler) not _linux_ (manually defined)
[ppp.git] / pppd / auth.c
index fa58933f77cfa190d6733c4132383adcc6946ab1..cf042686a33557e14fb1f81ce29b83c7a28c787b 100644 (file)
@@ -32,7 +32,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: auth.c,v 1.86 2002/10/10 06:12:04 fcusack Exp $"
+#define RCSID  "$Id: auth.c,v 1.88 2002/10/27 12:56:26 fcusack Exp $"
 
 #include <stdio.h>
 #include <stddef.h>
@@ -46,7 +46,7 @@
 #include <sys/socket.h>
 #include <utmp.h>
 #include <fcntl.h>
-#if defined(_PATH_LASTLOG) && defined(_linux_)
+#if defined(_PATH_LASTLOG) && defined(__linux__)
 #include <lastlog.h>
 #endif
 
@@ -610,6 +610,10 @@ network_phase(unit)
 {
     lcp_options *go = &lcp_gotoptions[unit];
 
+    /* Log calling number. */
+    if (*remote_number)
+       notice("peer from calling number %q authorized", remote_number);
+
     /*
      * If the peer had to authenticate, run the auth-up script now.
      */
@@ -1180,19 +1184,14 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg)
            ret = UPAP_AUTHACK;
            if (uselogin || login_secret) {
                /* login option or secret is @login */
-               ret = plogin(user, passwd, msg);
-               if (ret == UPAP_AUTHNAK)
-                   warn("PAP login failure for %s", user);
-               else
+               if ((ret = plogin(user, passwd, msg)) == UPAP_AUTHACK)
                    used_login = 1;
            }
            if (secret[0] != 0 && !login_secret) {
                /* password given in pap-secrets - must match */
                if ((cryptpap || strcmp(passwd, secret) != 0)
-                   && strcmp(crypt(passwd, secret), secret) != 0) {
+                   && strcmp(crypt(passwd, secret), secret) != 0)
                    ret = UPAP_AUTHNAK;
-                   warn("PAP authentication failure for %s", user);
-               }
            }
        }
        fclose(f);