X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=pppd%2Fmain.c;h=4fb985b89a010440c86bb6bf367604afae3b6448;hb=93b9f7ad08d5f0ee16880ec2b21b1c13a00d4779;hp=c6ba438a43576f021ce86721a0171a51b55d043b;hpb=29d737aafe8a1b61687a9b9e910b2d776dfc0203;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index c6ba438..4fb985b 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.114 2002/10/10 05:47:34 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()) { + error("remote number %s is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); + } + + if (dryrun) + die(0); + /* * Initialize system-dependent stuff. */