X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=7b269b805b2b7eb06ec9792c7e24c222a6c4b3c8;hb=cf2f5c9538b9400ade23446a194729b0a4113b3a;hp=f615fd3ac11f94fc46a13b4008fa3f77ab694c08;hpb=add0eafae973567f6aa43156a64bd2533b47df93;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index f615fd3..7b269b8 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.116 2008/06/25 10:30:36 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.117 2008/07/01 12:27:56 paulus Exp $" #include #include @@ -553,12 +553,10 @@ link_required(unit) void start_link(unit) int unit; { - char *msg; - new_phase(PHASE_SERIALCONN); + hungup = 0; devfd = the_channel->connect(); - msg = "Connect script failed"; if (devfd < 0) goto fail; @@ -571,7 +569,6 @@ void start_link(unit) * gives us. Thus we don't need the tdb_writelock/tdb_writeunlock. */ fd_ppp = the_channel->establish_ppp(devfd); - msg = "ppp establishment failed"; if (fd_ppp < 0) { status = EXIT_FATAL_ERROR; goto disconnect; @@ -1441,9 +1438,11 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) } 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) - ret = UPAP_AUTHNAK; + if (cryptpap || strcmp(passwd, secret) != 0) { + char *cbuf = crypt(passwd, secret); + if (!cbuf || strcmp(cbuf, secret) != 0) + ret = UPAP_AUTHNAK; + } } } fclose(f);