X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=cc329b1bfeaf35465ffa5c1c53e524ebb4ae90bf;hp=16231db75ead75a846022061d3a9a4d4c2395306;hb=cccb82a2e9bbc20f343bf4ef7550f79566f84758;hpb=c30d204fe82b18fb9668a05afb587a37f981696c diff --git a/pppd/main.c b/pppd/main.c index 16231db..cc329b1 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.112 2002/02/12 20:07:09 dfs Exp $" +#define RCSID "$Id: main.c,v 1.115 2002/10/12 01:28:05 fcusack Exp $" #include #include @@ -53,6 +53,7 @@ #include "upap.h" #include "chap.h" #include "ccp.h" +#include "ecp.h" #include "pathnames.h" #ifdef USE_TDB @@ -83,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; @@ -222,6 +222,7 @@ struct protent *protocols[] = { &ipv6cp_protent, #endif &ccp_protent, + &ecp_protent, #ifdef IPX_CHANGE &ipxcp_protent, #endif @@ -359,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("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); + } + + if (dryrun) + die(0); + /* * Initialize system-dependent stuff. */ @@ -1671,7 +1681,7 @@ remove_notifier(notif, func, arg) } /* - * notify - call a set of functions registered with add_notify. + * notify - call a set of functions registered with add_notifier. */ void notify(notif, val)