X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=4271af687102dc62e3c2e3b47d3fc8ab1d70d0f8;hb=ac682de4ec32d4cc8859b31366023e28012e23e6;hp=fb719446f7489895f0b51081c99b99c8221fd210;hpb=7a7ed0a1a26961a165fd17183fd161c36a4b088f;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index fb71944..4271af6 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -553,13 +553,11 @@ link_required(unit) void start_link(unit) int unit; { - char *msg; - + status = EXIT_CONNECT_FAILED; new_phase(PHASE_SERIALCONN); hungup = 0; devfd = the_channel->connect(); - msg = "Connect script failed"; if (devfd < 0) goto fail; @@ -572,7 +570,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; @@ -669,9 +666,11 @@ link_terminated(unit) (*the_channel->cleanup)(); if (doing_multilink && multilink_master) { - if (!bundle_terminating) + if (!bundle_terminating) { new_phase(PHASE_MASTER); - else + if (master_detach && !detached) + detach(); + } else mp_bundle_terminated(); } else new_phase(PHASE_DEAD); @@ -1442,9 +1441,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);