X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=d554bfd0f7e6aecb5cfa921f903a160fd45cc92f;hb=cb67581446e926290c6147634f7f467f48c806b5;hp=a4f7775adb6a5ff69ff090e590b7008bf01eb1cd;hpb=c4aa99cfadf0d5de94be64b8e76d7fbbf415b4df;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index a4f7775..d554bfd 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -73,7 +73,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.92 2003/02/16 22:29:50 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.93 2003/03/03 05:11:45 paulus Exp $" #include #include @@ -428,7 +428,8 @@ setupapfile(argv) /* get username */ if (fgets(u, MAXNAMELEN - 1, ufile) == NULL - || fgets(p, MAXSECRETLEN - 1, ufile) == NULL){ + || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { + fclose(ufile); option_error("unable to read user login data file %s", fname); return 0; } @@ -1149,6 +1150,14 @@ auth_check_options() exit(1); } + + /* + * Early check for remote number authorization. + */ + if (!auth_number()) { + warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); + } } /*