X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=b4271f837087e520f12f19b36da3370f44f5ba89;hp=c6ba438a43576f021ce86721a0171a51b55d043b;hb=9b5e4bcdc6e25f18d20200af78df94d695e428ac;hpb=7bb8beb860037a6c18dd0b64b8d542a20aa2c8c0 diff --git a/pppd/main.c b/pppd/main.c index c6ba438..b4271f8 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: main.c,v 1.113 2002/05/21 17:26:49 dfs Exp $" +#define RCSID "$Id: main.c,v 1.116 2002/10/12 02:30:21 fcusack Exp $" #include #include @@ -84,7 +84,6 @@ char hostname[MAXNAMELEN]; /* Our hostname */ static char pidfilename[MAXPATHLEN]; /* name of pid file */ static char linkpidfile[MAXPATHLEN]; /* name of linkname pid file */ char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ -char remote_number[MAXNAMELEN]; /* Remote telephone number, if available */ uid_t uid; /* Our real user-id */ struct notifier *pidchange = NULL; struct notifier *phasechange = NULL; @@ -361,10 +360,19 @@ main(argc, argv) init_pr_log(NULL, LOG_INFO); print_options(pr_log, NULL); end_pr_log(); - if (dryrun) - die(0); } + /* + * Early check for remote number authorization. + */ + if (!auth_number()) { + warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); + } + + if (dryrun) + die(0); + /* * Initialize system-dependent stuff. */