X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=9cc3af78490d9896eab94c7f27e4c54652f5870e;hb=6e6bb3246106e680463c106d1ee6b773fc4f9c5a;hp=002ec859f880abb2363982e62220902385272fa6;hpb=71d3de90eae52087b405e962ca650b71cec79c67;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index 002ec85..9cc3af7 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -10,16 +10,11 @@ * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The name(s) of the authors of this software must not be used to + * 2. The name(s) of the authors of this software must not be used to * endorse or promote products derived from this software without * prior written permission. * - * 4. Redistributions of any form whatsoever must retain the following + * 3. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras * ". @@ -73,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.95 2003/06/11 23:56:26 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.99 2004/11/04 10:02:26 paulus Exp $" #include #include @@ -1072,8 +1067,8 @@ connect_time_expired(arg) void *arg; { info("Connect time expired"); - lcp_close(0, "Connect time expired"); /* Close connection */ status = EXIT_CONNECT_TIME; + lcp_close(0, "Connect time expired"); /* Close connection */ } /* @@ -1109,12 +1104,14 @@ auth_check_options() if (auth_required) { allow_any_ip = 0; if (!wo->neg_chap && !wo->neg_upap && !wo->neg_eap) { - wo->neg_chap = 1; wo->chap_mdtype = MDTYPE_ALL; + wo->neg_chap = 1; + wo->chap_mdtype = chap_mdtype_all; wo->neg_upap = 1; wo->neg_eap = 1; } } else { - wo->neg_chap = 0; wo->chap_mdtype = MDTYPE_NONE; + wo->neg_chap = 0; + wo->chap_mdtype = MDTYPE_NONE; wo->neg_upap = 0; wo->neg_eap = 0; } @@ -1251,14 +1248,15 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) if (pap_auth_hook) { ret = (*pap_auth_hook)(user, passwd, msg, &addrs, &opts); if (ret >= 0) { + /* note: set_allowed_addrs() saves opts (but not addrs): + don't free it! */ if (ret) set_allowed_addrs(unit, addrs, opts); - BZERO(passwd, sizeof(passwd)); + else if (opts != 0) + free_wordlist(opts); if (addrs != 0) free_wordlist(addrs); - if (opts != 0) { - free_wordlist(opts); - } + BZERO(passwd, sizeof(passwd)); return ret? UPAP_AUTHACK: UPAP_AUTHNAK; } }