--- ppp-2.4.1.uus.orig/chat/Makefile.linux +++ ppp-2.4.1.uus/chat/Makefile.linux @@ -6,7 +6,7 @@ CDEF4= -DFNDELAY=O_NDELAY # Old name value CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) -CFLAGS= -O2 -g -pipe $(CDEFS) +CFLAGS= $(UDEB_CFLAGS) -O2 -g -pipe $(CDEFS) INSTALL= install --- ppp-2.4.1.uus.orig/chat/chat.8 +++ ppp-2.4.1.uus/chat/chat.8 @@ -154,7 +154,7 @@ .IP # Now wait for the prompt and send logout string .br -\'# ' logout +\&'# ' logout .LP .SH SENDING DATA FROM A FILE @@ -216,7 +216,7 @@ .br SAY "Dialling your ISP...\\n" .br -\'' ATDT5551212 +\&'' ATDT5551212 .br TIMEOUT 120 .br @@ -326,13 +326,13 @@ .br CONNECT \\c .br -\'Callback login:' call_back_ID +\&'Callback login:' call_back_ID .br HANGUP OFF .br ABORT "Bad Login" .br -\'Callback Password:' Call_back_password +\&'Callback Password:' Call_back_password .br TIMEOUT 120 .br --- ppp-2.4.1.uus.orig/chat/chat.c +++ ppp-2.4.1.uus/chat/chat.c @@ -203,7 +203,7 @@ int clear_abort_next = 0; char *report_string[MAX_REPORTS] ; -char report_buffer[50] ; +char report_buffer[256] ; int n_reports = 0, report_next = 0, report_gathering = 0 ; int clear_report_next = 0; --- ppp-2.4.1.uus.orig/etc.ppp/callback-users +++ ppp-2.4.1.uus/etc.ppp/callback-users @@ -0,0 +1,25 @@ +# User list file for callback +# Username option +# option - : no callback +# option * or empty: user definied +# option number : admin definied, callback to that number +# in username * and ? are valid wildcars, callback uses the best fit +# (There is a small bug in this subrutin in pppd, so check before use!) +# +# Examples: +# zotyo 67435 # user zotyo will called back at number 67453 +# # this is the so called admin definied option +# gates - # gates won't call back +# me * # Me call back any number what he gives! +# Everyone will be called back, so explicite define who MUST +# authencitated for callback and change below! + +# If there is no any authentication protocol (PAP, CHAP), +# anyone can use callback if he (she) wants. So don't forget +# to give these options to pppd: +pap or +chap or both. +# I prefer auth +pap -chap login options with mgetty. + +# Be carefull! +# If you remove the last hasmark EVERYONE is able to use CBCP! +# Please explicite define users to enable CBCP. +#* \ No newline at end of file --- ppp-2.4.1.uus.orig/pppd/plugins/Makefile.linux +++ ppp-2.4.1.uus/pppd/plugins/Makefile.linux @@ -16,4 +16,4 @@ install: minconn.so passprompt.so version=`awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h`; \ $(INSTALL) -d $(LIBDIR)/$$version; \ - $(INSTALL) $? $(LIBDIR)/$$version \ No newline at end of file + $(INSTALL) $? $(LIBDIR)/$$version --- ppp-2.4.1.uus.orig/pppd/Makefile.linux +++ ppp-2.4.1.uus/pppd/Makefile.linux @@ -15,7 +15,7 @@ MANPAGES = pppd.8 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \ auth.o options.o demand.o utils.o sys-linux.o ipxcp.o multilink.o \ - tdb.o tty.o + tdb.o tty.o cbcp.o all: pppd @@ -56,9 +56,9 @@ INCLUDE_DIRS= -I../include -COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP +COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP -DCBCP_SUPPORT -CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) +CFLAGS= $(UDEB_CFLAGS) $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) ifdef CHAPMS CFLAGS += -DCHAPMS=1 --- ppp-2.4.1.uus.orig/pppd/auth.c +++ ppp-2.4.1.uus/pppd/auth.c @@ -172,7 +172,6 @@ /* Prototypes for procedures local to this file. */ -static void network_phase __P((int)); static void check_idle __P((void *)); static void connect_time_expired __P((void *)); static int plogin __P((char *, char *, char **)); @@ -499,8 +498,7 @@ /* * Proceed to the network phase. */ -static void -network_phase(unit) +void network_phase(unit) int unit; { lcp_options *go = &lcp_gotoptions[unit]; @@ -520,7 +518,8 @@ /* * If we negotiated callback, do it now. */ - if (go->neg_cbcp) { + if (((go->neg_cbcp)||(lcp_hisoptions[ unit ].neg_cbcp)) + && (phase!=PHASE_CALLBACK)) { new_phase(PHASE_CALLBACK); (*cbcp_protent.open)(unit); return; @@ -1120,7 +1119,7 @@ if (pam_error == PAM_SUCCESS && !PAM_error) { pam_error = pam_acct_mgmt (pamh, PAM_SILENT); if (pam_error == PAM_SUCCESS) - pam_open_session (pamh, PAM_SILENT); + pam_error = pam_open_session (pamh, PAM_SILENT); } *msg = (char *) pam_strerror (pamh, pam_error); --- ppp-2.4.1.uus.orig/pppd/cbcp.c +++ ppp-2.4.1.uus/pppd/cbcp.c @@ -18,30 +18,23 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: cbcp.c,v 1.11 2001/03/08 05:11:10 paulus Exp $" +#ifndef lint +static const char rcsid[] = "$Id: cbcp.c,v 1.2 1997/04/30 05:50:26 paulus Exp $"; +#endif #include #include #include #include +#include +#include #include "pppd.h" #include "cbcp.h" #include "fsm.h" #include "lcp.h" - -static const char rcsid[] = RCSID; - -/* - * Options. - */ -static int setcbcp __P((char **)); - -static option_t cbcp_option_list[] = { - { "callback", o_special, setcbcp, - "Ask for callback", OPT_PRIO | OPT_A2STRVAL, &cbcp[0].us_number }, - { NULL } -}; +#include "ipcp.h" +#include "pathnames.h" /* * Protocol entry points. @@ -69,8 +62,6 @@ 0, "CBCP", NULL, - cbcp_option_list, - NULL, NULL, NULL }; @@ -79,26 +70,22 @@ /* internal prototypes */ +static void cbcp_sendreq __P((void *arg)); static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len)); -static void cbcp_resp __P((cbcp_state *us)); -static void cbcp_up __P((cbcp_state *us)); +static void cbcp_sendresp __P((cbcp_state *us)); +static void cbcp_recvresp __P((cbcp_state *us, char *pckt, int len)); +static void cbcp_sendack __P((void *)); static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len)); + static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len)); +static void cbcp_make_options __P((int unit)); +static int cbcp_check_user __P((char *user, char *mask)); +static void cbcp_start_callback __P((cbcp_state *us)); +static void cbcp_up __P((cbcp_state *us)); + + +cbcp_state *stop_iface = NULL; -/* option processing */ -static int -setcbcp(argv) - char **argv; -{ - lcp_wantoptions[0].neg_cbcp = 1; - cbcp_protent.enabled_flag = 1; - cbcp[0].us_number = strdup(*argv); - if (cbcp[0].us_number == 0) - novm("callback number"); - cbcp[0].us_type |= (1 << CB_CONF_USER); - cbcp[0].us_type |= (1 << CB_CONF_ADMIN); - return (1); -} /* init state */ static void @@ -110,7 +97,6 @@ us = &cbcp[iface]; memset(us, 0, sizeof(cbcp_state)); us->us_unit = iface; - us->us_type |= (1 << CB_CONF_NO); } /* lower layer is up */ @@ -120,18 +106,19 @@ { cbcp_state *us = &cbcp[iface]; - dbglog("cbcp_lowerup"); - dbglog("want: %d", us->us_type); - - if (us->us_type == CB_CONF_USER) - dbglog("phone no: %s", us->us_number); + CBCPDEBUG((LOG_DEBUG, "cbcp_lowerup")); + CBCPDEBUG((LOG_DEBUG, "want: %d", us->us_type)); } +/* CBCP indulhat: kliens oldal eseten nincs feladat, + szerver oldalon atkuldeni a valszthato opciokat */ static void cbcp_open(unit) int unit; { - dbglog("cbcp_open"); + CBCPDEBUG((LOG_DEBUG, "cbcp_open")); + if (lcp_hisoptions[unit].neg_cbcp) + cbcp_make_options(unit); } /* process an incomming packet */ @@ -146,11 +133,13 @@ u_short len; cbcp_state *us = &cbcp[unit]; + lcp_options *go = &lcp_gotoptions[unit]; + lcp_options *his = &lcp_hisoptions[unit]; inp = inpacket; if (pktlen < CBCP_MINLEN) { - error("CBCP packet is too small"); + syslog(LOG_ERR, "CBCP packet is too small"); return; } @@ -160,7 +149,7 @@ #if 0 if (len > pktlen) { - error("CBCP packet: invalid length"); + syslog(LOG_ERR, "CBCP packet: invalid length"); return; } #endif @@ -169,17 +158,36 @@ switch(code) { case CBCP_REQ: + if ( !go->neg_cbcp ) + { + syslog(LOG_ERR, "CBCP received CBCP_REQ, but CBCP running in server mode!"); + return; + } us->us_id = id; cbcp_recvreq(us, inp, len); break; case CBCP_RESP: - dbglog("CBCP_RESP received"); + if ( !his->neg_cbcp ) + { + syslog(LOG_ERR, "CBCP received CBCP_RESP, but CBCP running in client mode!"); + return; + } + if (id != us->us_id) + syslog(LOG_DEBUG, "id doesn't match: expected %d recv %d", + us->us_id, id); + + cbcp_recvresp(us, inp, len); break; case CBCP_ACK: + if ( !go->neg_cbcp ) + { + syslog(LOG_ERR, "CBCP received CBCP_ACK, but CBCP running in server mode!"); + return; + } if (id != us->us_id) - dbglog("id doesn't match: expected %d recv %d", + syslog(LOG_DEBUG, "id doesn't match: expected %d recv %d", us->us_id, id); cbcp_recvack(us, inp, len); @@ -259,13 +267,14 @@ printer(arg, " delay = %d", delay); } - if (olen > 3) { + if (olen > 4) { int addrt; char str[256]; GETCHAR(addrt, p); memcpy(str, p, olen - 4); str[olen - 4] = 0; + p += olen - 4; printer(arg, " number = %s", str); } printer(arg, ">"); @@ -291,41 +300,40 @@ char *pckt; int pcktlen; { - u_char type, opt_len, delay, addr_type; + u_char type, opt_len, addr_type; char address[256]; int len = pcktlen; address[0] = 0; while (len) { - dbglog("length: %d", len); - GETCHAR(type, pckt); GETCHAR(opt_len, pckt); + us->us_delay =0; if (opt_len > 2) - GETCHAR(delay, pckt); + GETCHAR(us->us_delay, pckt); us->us_allowed |= (1 << type); switch(type) { case CB_CONF_NO: - dbglog("no callback allowed"); + CBCPDEBUG((LOG_DEBUG, "no callback allowed")); break; case CB_CONF_USER: - dbglog("user callback allowed"); + CBCPDEBUG((LOG_DEBUG, "user callback allowed")); if (opt_len > 4) { GETCHAR(addr_type, pckt); memcpy(address, pckt, opt_len - 4); address[opt_len - 4] = 0; if (address[0]) - dbglog("address: %s", address); + CBCPDEBUG((LOG_DEBUG, "address: %s", address)); } break; case CB_CONF_ADMIN: - dbglog("user admin defined allowed"); + CBCPDEBUG((LOG_DEBUG, "user admin defined allowed")); break; case CB_CONF_LIST: @@ -334,60 +342,64 @@ len -= opt_len; } - cbcp_resp(us); + cbcp_sendresp(us); } static void -cbcp_resp(us) +cbcp_sendresp(us) cbcp_state *us; { - u_char cb_type; + u_char cb_allowed; u_char buf[256]; u_char *bufp = buf; int len = 0; - cb_type = us->us_allowed & us->us_type; - dbglog("cbcp_resp cb_type=%d", cb_type); + cb_allowed = us->us_allowed; + CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp: available options: %d", cb_allowed)); #if 0 - if (!cb_type) + if (!cb_allowed) lcp_down(us->us_unit); #endif - if (cb_type & ( 1 << CB_CONF_USER ) ) { - dbglog("cbcp_resp CONF_USER"); + if (cb_allowed & ( 1 << CB_CONF_USER ) ) { /* The best metod :-) */ + us->us_type= ( 1 << CB_CONF_USER ); + CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp CONF_USER")); PUTCHAR(CB_CONF_USER, bufp); len = 3 + 1 + strlen(us->us_number) + 1; PUTCHAR(len , bufp); - PUTCHAR(5, bufp); /* delay */ + PUTCHAR(us->us_delay, bufp); PUTCHAR(1, bufp); BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); cbcp_send(us, CBCP_RESP, buf, len); return; } - if (cb_type & ( 1 << CB_CONF_ADMIN ) ) { - dbglog("cbcp_resp CONF_ADMIN"); + if (cb_allowed & ( 1 << CB_CONF_ADMIN ) ) { + us->us_type= ( 1 << CB_CONF_ADMIN ); + CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp CONF_ADMIN")); PUTCHAR(CB_CONF_ADMIN, bufp); len = 3; - PUTCHAR(len, bufp); - PUTCHAR(5, bufp); /* delay */ + PUTCHAR(len , bufp); + PUTCHAR(us->us_delay, bufp); cbcp_send(us, CBCP_RESP, buf, len); return; } - if (cb_type & ( 1 << CB_CONF_NO ) ) { - dbglog("cbcp_resp CONF_NO"); + if (cb_allowed & ( 1 << CB_CONF_NO ) ) { + us->us_type= ( 1 << CB_CONF_NO ); + CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp CONF_NO")); PUTCHAR(CB_CONF_NO, bufp); len = 3; PUTCHAR(len , bufp); PUTCHAR(0, bufp); cbcp_send(us, CBCP_RESP, buf, len); - start_networks(); return; } + syslog(LOG_WARNING, "cbcp_sendresp: no usable options available!"); } +/* Send the packet */ static void cbcp_send(us, code, buf, len) cbcp_state *us; @@ -414,43 +426,427 @@ output(us->us_unit, outpacket_buf, outlen + PPP_HDRLEN); } +/* Received Ack */ static void cbcp_recvack(us, pckt, len) cbcp_state *us; char *pckt; int len; { - u_char type, delay, addr_type; + u_char type, addr_type; int opt_len; char address[256]; + stop_iface = us; + if (len) { GETCHAR(type, pckt); GETCHAR(opt_len, pckt); if (opt_len > 2) - GETCHAR(delay, pckt); + GETCHAR(us->us_delay, pckt); if (opt_len > 4) { GETCHAR(addr_type, pckt); memcpy(address, pckt, opt_len - 4); address[opt_len - 4] = 0; if (address[0]) - dbglog("peer will call: %s", address); + CBCPDEBUG((LOG_DEBUG, "peer will call: %s", address)); } - if (type == CB_CONF_NO) - return; + if (type != CB_CONF_NO) + { + callback_in_progress = us->us_unit + 1; + callback_in_progress |= CBCP_CLIENT; + cbcp_up(us); + } + else + network_phase(us->us_unit); } + else + syslog(LOG_DEBUG, "cbcp: received bad ack - packet too small"); + - cbcp_up(us); } -/* ok peer will do callback */ +/* Make options + if auth req, options from callback-users file, else use CBCP_CONF_USER */ +static void +cbcp_make_options (unit) + int unit; +{ + cbcp_state *us = &cbcp[unit]; + FILE *userfile; + struct stat sbuf; + int best_fit, got_fit, newline; + char uname[ 256 ], option[ 256 ]; + + us->us_id = 1; + us->us_count = 0; + us->us_delay = 5; /* Default delay 5 seconds */ + if ( *peer_authname ) { /* Username available */ + userfile = fopen( _PATH_CBCP_USERS, "r" ); + if ( userfile == NULL ){ + syslog( LOG_ERR, "Can't open callback user file: %s %m", + _PATH_CBCP_USERS ); + syslog( LOG_WARNING, "Allow user definied callback." ); + us->us_allowed = ( 1 << CB_CONF_USER ); + }else + { + if ( fstat(fileno(userfile), &sbuf) < 0) { + syslog(LOG_WARNING, "Cannot stat userfile file %s: %m", + _PATH_CBCP_USERS ); + } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { + syslog(LOG_WARNING, "Warning - user file %s has world and/or group access", + _PATH_CBCP_USERS ); + } + + us->us_allowed = ( 1 << CB_CONF_NO ); /* Assume, no callback allowed */ + + if (getword(userfile, uname, &newline, _PATH_CBCP_USERS)){ /* file not empty */ + newline = 1; + best_fit = 0; + *option = '-'; + for (;;) { + /* + * Skip until we find a word at the start of a line. + */ + while (!newline && getword(userfile, uname, + &newline, _PATH_CBCP_USERS)) + ; + if (!newline) + break; /* got to end of file */ + + /* + * Got a user - check if it's a match or a wildcard. + */ + got_fit = cbcp_check_user( peer_authname, uname ); + if ( got_fit <= best_fit ){ + newline = 0; + continue; + } + + /* Read the options */ + best_fit = got_fit; + if (!getword(userfile, option, &newline, _PATH_CBCP_USERS)) + break; + + if ( newline ) + *option = 0; + + if ( best_fit == 100 ) + break; + } + } + + switch ( *option ){ + case '-' : us->us_allowed = ( 1 << CB_CONF_NO ); break; + case '*' : + case 0 : us->us_allowed = ( 1 << CB_CONF_USER ); break; + default : us->us_allowed = ( 1 << CB_CONF_ADMIN ); + us->us_number = strdup( option ); break; + } + fclose( userfile ); + } + } + else + us->us_allowed = ( 1 << CB_CONF_USER ); + + cbcp_sendreq( us ); +} + + +/* make cbcp request packet & send it */ +static void +cbcp_sendreq (arg) + void *arg; +{ + cbcp_state *us=(cbcp_state *)arg; + u_char cb_allow = us->us_allowed; + u_char buf[256]; + u_char *bufp = buf; + int len = 0; + + us->us_count++; + if (us->us_count<=CBCP_MAXRETRY) + TIMEOUT( cbcp_sendreq, arg, CBCP_DEFTIMEOUT ); + else + { + lcp_close(0, "Sorry, CBCP not responding."); + return; + } + CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq cb_allowed=%d", cb_allow)); + + + if (cb_allow & ( 1 << CB_CONF_USER ) ) { + CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq CONF_USER")); + PUTCHAR(CB_CONF_USER, bufp); + len+=3; + PUTCHAR(3 , bufp); + PUTCHAR(us->us_delay, bufp); + } + + if (cb_allow & ( 1 << CB_CONF_ADMIN ) ) { + CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq CONF_ADMIN")); + PUTCHAR(CB_CONF_ADMIN, bufp); + len += 3; + PUTCHAR(3 , bufp); + PUTCHAR(us->us_delay, bufp); + } + + if (cb_allow & ( 1 << CB_CONF_NO ) ) { + CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq CONF_NO")); + PUTCHAR(CB_CONF_NO, bufp); + len += 3; + PUTCHAR(3 , bufp); + PUTCHAR(us->us_delay, bufp); + } + + if (len) + cbcp_send(us, CBCP_REQ, buf, len); + else + { + syslog(LOG_WARNING, "cbcp: no available options to client!"); + } +} + +/* Received CBCP response, make ACK */ +static void +cbcp_recvresp (us, pckt, len) + cbcp_state *us; + char *pckt; + int len; +{ + u_char type, addr_type; + int opt_len; + char address[256]; + + if (len) { + GETCHAR(type, pckt); + GETCHAR(opt_len, pckt); + + if (!(( 1 << type )& us->us_allowed )) { + CBCPDEBUG((LOG_DEBUG, "CBCP received options not allowed on server!")); + return; + } + + if ((type!= CB_CONF_NO ) && + (type!= CB_CONF_USER ) && + (type!= CB_CONF_ADMIN )) { + syslog(LOG_DEBUG, "CBCP received BAD Response: too more or unknown options %d",type); + return; + } + + UNTIMEOUT( cbcp_sendreq, us ); + us->us_count = 0; + + + if (opt_len > 2) + GETCHAR(us->us_delay, pckt) + if ( us->us_delay < 5 ) + us->us_delay = 5; + + if (opt_len > 4) { + GETCHAR(addr_type, pckt); /* Address Type mezo elvesztve !!! */ + memcpy(address, pckt, opt_len - 4); + address[opt_len - 4] = 0; + if (address[0]) + syslog(LOG_DEBUG, "peer will callback the client on: %s", address); + us->us_number=strdup( address ); + } + + us->us_type = ( 1 << type ); + cbcp_sendack( us ); + } + else + { + syslog(LOG_DEBUG, "CBCP received BAD Response: size to small"); + } +} + +/* Send the CBCP_ACK packet */ +static void +cbcp_sendack (arg) + void *arg; +{ + cbcp_state *us= (cbcp_state *)arg; + u_char cb_type; + u_char buf[256]; + u_char *bufp = buf; + int len = 0; + + stop_iface = (cbcp_state *)arg; + cb_type = us->us_type; + + CBCPDEBUG((LOG_DEBUG, "cbcp_sendack cb_type=%d", cb_type)); + + us->us_count++; + if (us->us_count<=CBCP_MAXRETRY) + TIMEOUT( cbcp_sendack, arg, CBCP_DEFTIMEOUT ); + else + { + lcp_close(0, "Sorry, CBCP not responding."); + return; + } + +#if 0 + if (!cb_type) + lcp_down(us->us_unit); +#endif + + if (cb_type == (1 << CB_CONF_USER )) { + CBCPDEBUG((LOG_DEBUG, "cbcp_sendack CONF_USER")); + PUTCHAR(CB_CONF_USER, bufp); + len = 3 + 1 + strlen(us->us_number) + 1; + PUTCHAR(len , bufp); + PUTCHAR(us->us_delay, bufp); /* delay */ + PUTCHAR(1, bufp); /* Elvesztett byte... */ + BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); + cbcp_send(us, CBCP_ACK, buf, len); +/* lcp_close( 2, "Illegal, but required to server..." ); */ + callback_in_progress = us->us_unit + 1; + return; + } + + if (cb_type == (1 << CB_CONF_ADMIN )) { + CBCPDEBUG((LOG_DEBUG, "cbcp_sendack CONF_ADMIN")); + PUTCHAR(CB_CONF_ADMIN, bufp); + len = 3 + 1; + PUTCHAR(len , bufp); + PUTCHAR(us->us_delay, bufp); /* delay */ + PUTCHAR(0, bufp); + cbcp_send(us, CBCP_ACK, buf, len); +/* lcp_close( 2, "Illegal, but required to server..." ); */ + callback_in_progress = us->us_unit + 1; + return; + } + + if (cb_type == (1 << CB_CONF_NO )) { + CBCPDEBUG((LOG_DEBUG, "cbcp_sendack CONF_NO")); + PUTCHAR(CB_CONF_NO, bufp); + len = 3; + PUTCHAR(len , bufp); + PUTCHAR(0, bufp); + cbcp_send(us, CBCP_ACK, buf, len); + if (us->us_count<=1) + network_phase(us->us_unit); + return; + } + + syslog(LOG_DEBUG, "CBCP - Bad options in Ack routine."); + +} + +/* CBCP coming succesful up */ +void cbcp_stop() +{ + if ( stop_iface && lcp_allowoptions[stop_iface->us_unit].neg_cbcp ) + { + UNTIMEOUT( cbcp_sendack, stop_iface ); + cbcp_start_callback( stop_iface ); + } +} + +/* The server side coming up & client 'ack-ed' */ +void cbcp_start_callback (us) + cbcp_state *us; +{ + lcp_allowoptions[us->us_unit].neg_cbcp=0; + + CBCPDEBUG((LOG_DEBUG, "cbcp_start_callback running")); +} + +/* The client side coming up: server allowed the callback */ static void cbcp_up(us) cbcp_state *us; { - persist = 0; - lcp_close(0, "Call me back, please"); - status = EXIT_CALLBACK; + lcp_wantoptions[us->us_unit].neg_cbcp=0; + CBCPDEBUG((LOG_DEBUG, "cbcp_up called")); + lcp_close(us->us_unit, "Call me back, please"); } + +/* The main module gets the script with parameters to run */ +char *cbcp_get_script() +{ + cbcp_state *us = &cbcp[(callback_in_progress & CBCP_NCLIENT)-1]; + char script[ 256 ]; + + if ( callback_in_progress & CBCP_CLIENT ) + sprintf( script, "%s %d", _PATH_CBCP_CLIENT, us->us_delay ); + else + sprintf( script, "%s %d %s", _PATH_CBCP_SERVER, + us->us_delay, us->us_number ); + + return strdup( script ); +} + +/* give me the hit rate. wild cars '*?' valids */ +int cbcp_check_user ( user, mask ) + char *user; + char *mask; +{ + char *curr_user = user; + char *curr_mask = mask; + char *find, backp = 0; + int count, len = 0; + + if ( !strcmp( user, mask )) + return 100; + + if ( !strcmp( mask, "*" )) + return 1; + + if ( !*user ) + return 0; + + count = 0; + + while(( find = strpbrk( curr_mask, "*?" )) != 0 ) { + if ( find != curr_mask ){ + len = find - curr_mask; + if ( strncmp( curr_user, curr_mask, len )) + break; + } + + curr_mask += len + 1; + curr_user += len; + count += len; + if ( *curr_user == 0 ) + break; + + if ( *find == '?' ) { + curr_user++; + if ( *curr_user == 0 ) + break; + } else { + if ( *curr_mask == 0 ) + break; + + if ( ( find = strpbrk( curr_mask, "*?" )) != 0 ){ + backp = *find; + *find = 0; + } + curr_user = strstr( curr_user, curr_mask ); + if ( find ) + *find = backp; + if ( !curr_user ) + break; + + find = strpbrk( curr_mask, "*?" ); + if ( find ) + len = find - curr_mask; + else + len = strlen( curr_mask ); + + curr_mask += len; + curr_user += len; + count += len; + } + } + + if ( *curr_user && *curr_mask && !strcmp( curr_user, curr_mask )) + count += strlen( curr_user ); + + return ( count * 100 / strlen( user ) ); +} + --- ppp-2.4.1.uus.orig/pppd/cbcp.h +++ ppp-2.4.1.uus/pppd/cbcp.h @@ -6,6 +6,8 @@ u_char us_id; /* Current id */ u_char us_allowed; int us_type; + u_char us_delay; + u_char us_count; char *us_number; /* Telefone Number */ } cbcp_state; @@ -19,8 +21,19 @@ #define CBCP_RESP 2 #define CBCP_ACK 3 +#define CBCP_DEFTIMEOUT 5 +#define CBCP_MAXRETRY 50 +#define CBCP_CLIENT 0x8000 +#define CBCP_NCLIENT 0x7fff + +#define CBCPDEBUG(x) if (debug) syslog x + #define CB_CONF_NO 1 #define CB_CONF_USER 2 #define CB_CONF_ADMIN 3 #define CB_CONF_LIST 4 + +char *cbcp_get_script __P(()); +void cbcp_stop __P(()); + #endif --- ppp-2.4.1.uus.orig/pppd/fsm.c +++ ppp-2.4.1.uus/pppd/fsm.c @@ -214,12 +214,21 @@ /* Init restart counter, send Terminate-Request */ f->retransmits = f->maxtermtransmits; - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, f->timeouttime); - --f->retransmits; - - f->state = CLOSING; + if (f->retransmits > 0) { + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (u_char *) f->term_reason, f->term_reason_len); + TIMEOUT(fsm_timeout, f, f->timeouttime); + --f->retransmits; + + f->state = CLOSING; + } else { + /* + * Term requests disabled at the user's discretion. + */ + f->state = CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + } break; } } --- ppp-2.4.1.uus.orig/pppd/ipcp.c +++ ppp-2.4.1.uus/pppd/ipcp.c @@ -37,6 +37,9 @@ #include "fsm.h" #include "ipcp.h" #include "pathnames.h" +#ifdef CBCP_SUPPORT +#include "cbcp.h" +#endif static const char rcsid[] = RCSID; @@ -109,7 +112,8 @@ static int setdnsaddr __P((char **)); static int setwinsaddr __P((char **)); static int setnetmask __P((char **)); -static int setipaddr __P((char *, char **, int)); +/* setipaddr() must not be static, otherwise you can't connect with portslave */ +int setipaddr __P((char *, char **, int)); static void printipaddr __P((option_t *, void (*)(void *, char *,...),void *)); static option_t ipcp_option_list[] = { @@ -241,6 +245,13 @@ #define CILEN_ADDR 6 /* new-style single address option */ #define CILEN_ADDRS 10 /* old-style dual address option */ +/* + * Added to allow static and dynamic ips(s) + * Hold the static address from pap-secrets + */ +u_int32_t staticaddr; +/******************************************/ + #define CODENAME(x) ((x) == CONFACK ? "ACK" : \ (x) == CONFNAK ? "NAK" : "REJ") @@ -368,7 +379,7 @@ * If doit is 0, the call is to check whether this option is * potentially an IP address specification. */ -static int +int setipaddr(arg, argv, doit) char *arg; char **argv; @@ -1216,6 +1227,10 @@ u_char maxslotindex, cflag; int d; +#ifdef CBCP_SUPPORT + cbcp_stop(); +#endif + /* * Reset all his options. */ @@ -1263,6 +1278,15 @@ orc = CONFNAK; if (!reject_if_disagree) { DECPTR(sizeof(u_int32_t), p); + + /* + * Added to allow static and dynamic ip(s) + * Are they asking for their static ip from pap-secrets? + */ + if(ciaddr1 !=0 && ciaddr1 == staticaddr) + wo->hisaddr = staticaddr; /* Let them use the static ip */ + /*******************************************/ + tl = ntohl(wo->hisaddr); PUTLONG(tl, p); } @@ -1718,7 +1742,7 @@ */ if (ipcp_script_state == s_down && ipcp_script_pid == 0) { ipcp_script_state = s_up; - ipcp_script(_PATH_IPUP); + ipcp_script(path_ipup); } } @@ -1761,7 +1785,7 @@ /* Execute the ip-down script */ if (ipcp_script_state == s_up && ipcp_script_pid == 0) { ipcp_script_state = s_down; - ipcp_script(_PATH_IPDOWN); + ipcp_script(path_ipdown); } } @@ -1812,13 +1836,13 @@ case s_up: if (ipcp_fsm[0].state != OPENED) { ipcp_script_state = s_down; - ipcp_script(_PATH_IPDOWN); + ipcp_script(path_ipdown); } break; case s_down: if (ipcp_fsm[0].state == OPENED) { ipcp_script_state = s_up; - ipcp_script(_PATH_IPUP); + ipcp_script(path_ipup); } break; } @@ -2012,7 +2036,7 @@ */ #define IP_HDRLEN 20 /* bytes */ #define IP_OFFMASK 0x1fff -#define IPPROTO_TCP 6 +/* in /usr/include/netinet/in.h #define IPPROTO_TCP 6 */ #define TCP_HDRLEN 20 #define TH_FIN 0x01 --- ppp-2.4.1.uus.orig/pppd/ipcp.h +++ ppp-2.4.1.uus/pppd/ipcp.h @@ -70,4 +70,10 @@ char *ip_ntoa __P((u_int32_t)); +/* Added to allow static and dynamic ip(s). + * Holds the static ip from pap-secrets + */ +u_int32_t staticaddr; +/******************************************/ + extern struct protent ipcp_protent; --- ppp-2.4.1.uus.orig/pppd/ipv6cp.c +++ ppp-2.4.1.uus/pppd/ipv6cp.c @@ -121,6 +121,9 @@ #include "ipv6cp.h" #include "magic.h" #include "pathnames.h" +#ifdef CBCP_SUPPORT +#include "cbcp.h" +#endif static const char rcsid[] = RCSID; @@ -852,6 +855,10 @@ u_char *p; /* Pointer to next char to parse */ u_char *ucp = inp; /* Pointer to current output char */ int l = *len; /* Length left */ + +#ifdef CBCP_SUPPORT + cbcp_stop(); +#endif /* * Reset all his options. --- ppp-2.4.1.uus.orig/pppd/ipxcp.c +++ ppp-2.4.1.uus/pppd/ipxcp.c @@ -38,6 +38,9 @@ #include "ipxcp.h" #include "pathnames.h" #include "magic.h" +#ifdef CBCP_SUPPORT +#include "cbcp.h" +#endif static const char rcsid[] = RCSID; @@ -974,6 +977,10 @@ u_char *p; /* Pointer to next char to parse */ u_char *ucp = inp; /* Pointer to current output char */ int l = *len; /* Length left */ + +#ifdef CBCP_SUPPORT + cbcp_stop(); +#endif /* * Reset all his options. --- ppp-2.4.1.uus.orig/pppd/lcp.c +++ ppp-2.4.1.uus/pppd/lcp.c @@ -342,9 +342,6 @@ ao->neg_magicnumber = 1; ao->neg_pcompression = 1; ao->neg_accompression = 1; -#ifdef CBCP_SUPPORT - ao->neg_cbcp = 1; -#endif ao->neg_endpoint = 1; } @@ -1703,6 +1700,16 @@ INCPTR(cilen, p); break; + case CI_CALLBACK: + LCPDEBUG((LOG_INFO, "lcp_reqci: rcvd CALLBACK")); + if (!ao->neg_cbcp || + cilen != CILEN_CHAR) { + orc = CONFREJ; + break; + } + ho->neg_cbcp = 1; + break; + default: LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); orc = CONFREJ; --- ppp-2.4.1.uus.orig/pppd/main.c +++ ppp-2.4.1.uus/pppd/main.c @@ -138,6 +138,11 @@ int link_connect_time; int link_stats_valid; +#ifdef CBCP_SUPPORT +int callback_in_progress; /* Callback running indicator */ +#endif + + /* * We maintain a list of child process pids and * functions to call when they exit. @@ -233,6 +238,9 @@ struct protent *protp; char numbuf[16]; + strlcpy(path_ipup, "/etc/ppp/ip-up", sizeof(path_ipup)); + strlcpy(path_ipdown, "/etc/ppp/ip-down", sizeof(path_ipup)); + new_phase(PHASE_INITIALIZE); /* @@ -478,8 +486,13 @@ add_fd(fd_ppp); lcp_open(0); /* Start protocol */ +#ifdef CBCP_SUPPORT + for( callback_in_progress=1;callback_in_progress;) { /* Extra loop for callback */ + callback_in_progress=0; +#endif status = EXIT_NEGOTIATION_FAILED; new_phase(PHASE_ESTABLISH); + while (phase != PHASE_DEAD) { handle_events(); get_input(); @@ -493,6 +506,57 @@ } } +#ifdef CBCP_SUPPORT + if (callback_in_progress){ + cbcp_stop(); + remove_fd(fd_ppp); + clean_check(); + the_channel->disestablish_ppp(devfd); + fd_ppp = -1; + if (!hungup) + lcp_lowerdown(0); + + the_channel->disconnect(); + the_channel->close(); + hungup=0; + + devfd = the_channel->connect(); + if (devfd < 0) + goto fail; + + cbcp_protent.enabled_flag = 0; /* Already not needed */ + + /* set up the serial device as a ppp interface */ + tdb_writelock(pppdb); + fd_ppp = the_channel->establish_ppp(devfd); + if (fd_ppp < 0) { + tdb_writeunlock(pppdb); + status = EXIT_FATAL_ERROR; + goto disconnect; + } + + if (!demand && ifunit >= 0) + set_ifunit(1); + tdb_writeunlock(pppdb); + + /* + * Start opening the connection and wait for + * incoming events (reply, timeout, etc.). + */ + notice("Connect: %s <--> %s", ifname, ppp_devnam); + gettimeofday(&start_time, NULL); + link_stats_valid = 0; + script_unsetenv("CONNECT_TIME"); + script_unsetenv("BYTES_SENT"); + script_unsetenv("BYTES_RCVD"); + lcp_lowerup(0); + + add_fd(fd_ppp); + lcp_open(0); /* Start protocol */ + } + } +#endif + /* * Print connect time and statistics. */ @@ -526,6 +590,7 @@ fd_ppp = -1; if (!hungup) lcp_lowerdown(0); + if (!demand) script_unsetenv("IFNAME"); @@ -1576,7 +1641,8 @@ (chp? chp->prog: "??"), pid, WTERMSIG(status)); } else if (debug) dbglog("Script %s finished (pid %d), status = 0x%x", - (chp? chp->prog: "??"), pid, status); + (chp? chp->prog: "??"), pid, + WIFEXITED(status) ? WEXITSTATUS(status) : status); if (chp && chp->done) (*chp->done)(chp->arg); if (chp) @@ -1778,6 +1844,9 @@ dbuf.dsize = vlen; if (tdb_store(pppdb, key, dbuf, TDB_REPLACE)) error("tdb_store failed: %s", tdb_error(pppdb)); + + if (vbuf) + free(vbuf); } --- ppp-2.4.1.uus.orig/pppd/options.c +++ ppp-2.4.1.uus/pppd/options.c @@ -43,6 +43,13 @@ char *strdup __P((char *)); #endif +#ifdef CBCP_SUPPORT +#include "fsm.h" +#include "lcp.h" +#include "cbcp.h" +#endif + + static const char rcsid[] = RCSID; struct option_value { @@ -85,6 +92,8 @@ bool dump_options; /* print out option values */ bool dryrun; /* print out option values and exit */ char *domain; /* domain name set by domain option */ +char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ +char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ extern option_t auth_options[]; extern struct stat devstat; @@ -128,6 +137,11 @@ static int n_arguments __P((option_t *)); static int number_option __P((char *, u_int32_t *, int)); +#ifdef CBCP_SUPPORT +static int setcbcp __P((char**)); +#endif + + /* * Structure to store extra lists of options. */ @@ -231,6 +245,12 @@ "Print out option values after parsing all options", 1 }, { "dryrun", o_bool, &dryrun, "Stop after parsing, printing, and checking options", 1 }, + { "ip-up-script", o_string, path_ipup, + "Set pathname of ip-up script", + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, + { "ip-down-script", o_string, path_ipdown, + "Set pathname of ip-down script", + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, #ifdef HAVE_MULTILINK { "multilink", o_bool, &multilink, @@ -262,6 +282,11 @@ "set filter for active pkts", OPT_PRIO }, #endif +#ifdef CBCP_SUPPORT + { "callback", o_special, setcbcp, + "Callback request to server - OR - calling back the client." }, +#endif + { NULL } }; @@ -1511,3 +1536,23 @@ return 0; } #endif /* PLUGIN */ + +#ifdef CBCP_SUPPORT +static int +setcbcp(argv) + char **argv; +{ + cbcp[0].us_number = strdup(*argv); + if (cbcp_protent.enabled_flag) + novm("Only one callback parameter supported!"); + if (cbcp[0].us_number == 0) + novm("callback number"); + if (!strcmp(cbcp[0].us_number,"server")){ + lcp_allowoptions[0].neg_cbcp = 1; + } else { + lcp_wantoptions[0].neg_cbcp = 1; + } + cbcp_protent.enabled_flag = 1; + return 1; +} +#endif --- ppp-2.4.1.uus.orig/pppd/patchlevel.h +++ ppp-2.4.1.uus/pppd/patchlevel.h @@ -1,4 +1,4 @@ /* $Id: patchlevel.h,v 1.53 2001/03/25 04:51:54 paulus Exp $ */ -#define VERSION "2.4.1" -#define DATE "25 March 2001" +#define VERSION "2.4.1 with Callback extension" +#define DATE "21 Juni 2001" --- ppp-2.4.1.uus.orig/pppd/pathnames.h +++ ppp-2.4.1.uus/pppd/pathnames.h @@ -21,12 +21,10 @@ #define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets" #define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets" #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options" -#define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up" -#define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down" #define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" #define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." -#define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" +#define _PATH_CONNERRS _ROOT_PATH "/var/log/ppp-connect-errors" #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" #define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" @@ -55,3 +53,10 @@ #ifdef PLUGIN #define _PATH_PLUGIN "/usr/lib/pppd/" VERSION #endif /* PLUGIN */ + +#ifdef CBCP_SUPPORT +#define _PATH_CBCP_SERVER "/etc/ppp/callback-server" +#define _PATH_CBCP_CLIENT "/etc/ppp/callback-client" +#define _PATH_CBCP_USERS "/etc/ppp/callback-users" +#define _PATH_CBCP_ "/etc/ppp/callback" +#endif /* CBCP_SUPPORT */ --- ppp-2.4.1.uus.orig/pppd/pppd.8 +++ ppp-2.4.1.uus/pppd/pppd.8 @@ -190,9 +190,7 @@ except that qualifiers which are inappropriate for a PPP link, such as \fBether\fR and \fBarp\fR, are not permitted. Generally the filter expression should be enclosed in single-quotes to prevent whitespace -in the expression from being interpreted by the shell. This option -is currently only available under NetBSD, and then only -if both the kernel and pppd were compiled with PPP_FILTER defined. +in the expression from being interpreted by the shell. .TP .B allow-ip \fIaddress(es) Allow peers to use the given IP address or subnet without @@ -790,7 +788,8 @@ .TP .B persist Do not exit after a connection is terminated; instead try to reopen -the connection. +the connection. The \fBmaxfail\fR option still has an effect on +persistent connections. .TP .B plugin \fIfilename Load the shared library object file \fIfilename\fR as a plugin. This --- ppp-2.4.1.uus.orig/pppd/pppd.h +++ ppp-2.4.1.uus/pppd/pppd.h @@ -147,6 +147,8 @@ struct pppd_stats { unsigned int bytes_in; unsigned int bytes_out; + unsigned int packets_in; + unsigned int packets_out; }; /* Used for storing a sequence of words. Usually malloced. */ @@ -217,6 +219,9 @@ extern struct notifier *exitnotify; /* for notification that we're exiting */ extern struct notifier *sigreceived; /* notification of received signal */ extern int listen_time; /* time to listen first (ms) */ +#ifdef CBCP_SUPPORT +extern int callback_in_progress; /* callback indicator */ +#endif /* Values for do_callback and doing_callback */ #define CALLBACK_DIALIN 1 /* we are expecting the call back */ @@ -272,6 +277,8 @@ extern char *bundle_name; /* bundle name for multilink */ extern bool dump_options; /* print out option values */ extern bool dryrun; /* check everything, print options, exit */ +extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ +extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ #ifdef PPP_FILTER extern struct bpf_program pass_filter; /* Filter for pkts to pass */ @@ -288,6 +295,10 @@ extern char *option_source; /* string saying where the option came from */ extern int option_priority; /* priority of current options */ +#ifdef CBCP_SUPPORT +extern int callback_in_progress; /* Callback state indicator */ +#endif + /* * Values for phase. */ @@ -443,6 +454,7 @@ void end_pr_log __P((void)); /* finish up after using pr_log */ /* Procedures exported from auth.c */ +void network_phase __P((int)); /* the dataexcahnger CP-s goung up */ void link_required __P((int)); /* we are starting to use the link */ void link_terminated __P((int)); /* we are finished with the link */ void link_down __P((int)); /* the LCP layer has left the Opened state */ @@ -570,6 +582,7 @@ char *get_first_ethernet __P((void)); /* Procedures exported from options.c */ +int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */ int parse_args __P((int argc, char **argv)); /* Parse options from arguments given */ int options_from_file __P((char *filename, int must_exist, int check_prot, --- ppp-2.4.1.uus.orig/pppd/sys-linux.c +++ ppp-2.4.1.uus/pppd/sys-linux.c @@ -1236,6 +1236,8 @@ } stats->bytes_in = req.stats.p.ppp_ibytes; stats->bytes_out = req.stats.p.ppp_obytes; + stats->packets_in = req.stats.p.ppp_ipackets; + stats->packets_out = req.stats.p.ppp_opackets; return 1; } --- ppp-2.4.1.uus.orig/pppd/tty.c +++ ppp-2.4.1.uus/pppd/tty.c @@ -49,6 +49,11 @@ #include "fsm.h" #include "lcp.h" +#ifdef CBCP_SUPPORT +#include "cbcp.h" +#endif + + void tty_process_extra_options __P((void)); void tty_check_options __P((void)); int connect_tty __P((void)); @@ -499,6 +504,12 @@ hungup = 0; kill_link = 0; connector = doing_callback? callback_script: connect_script; +#ifdef CBCP_SUPPORT + if ( callback_in_progress ) + { + connector = cbcp_get_script(); + } +#endif if (devnam[0] != 0) { for (;;) { /* If the user specified the device name, become the @@ -616,7 +627,15 @@ if (connector && connector[0]) { if (device_script(connector, ttyfd, ttyfd, 0) < 0) { +#ifdef CBCP_SUPPORT + if ( callback_in_progress ) { + error("Callback script failed" ); + } else { +#endif error("Connect script failed"); +#ifdef CBCP_SUPPORT + } +#endif status = EXIT_CONNECT_FAILED; return -1; } @@ -656,7 +675,11 @@ script_setenv("SPEED", numbuf, 0); /* run welcome script, if any */ - if (welcomer && welcomer[0]) { + if (welcomer && welcomer[0] +#ifdef CBCP_SUPPORT + && !callback_in_progress +#endif + ) { if (device_script(welcomer, ttyfd, ttyfd, 0) < 0) warn("Welcome script failed"); } @@ -675,7 +698,11 @@ void disconnect_tty() { - if (disconnect_script == NULL || hungup) + if (disconnect_script == NULL || hungup +#ifdef CBCP_SUPPORT + || callback_in_progress +#endif + ) return; if (real_ttyfd >= 0) set_up_tty(real_ttyfd, 1); --- ppp-2.4.1.uus.orig/pppd/utils.c +++ ppp-2.4.1.uus/pppd/utils.c @@ -819,9 +819,20 @@ major(sbuf.st_rdev), minor(sbuf.st_rdev)); #else char *p; + char lockdev[MAXPATHLEN]; + + if ((p = strstr(dev, "dev/")) != NULL) { + dev = p + 4; + strncpy(lockdev, dev, MAXPATHLEN-1); + lockdev[MAXPATHLEN-1] = 0; + while ((p = strrchr(lockdev, '/')) != NULL) { + *p = '_'; + } + dev = lockdev; + } else + if ((p = strrchr(dev, '/')) != NULL) + dev = p + 1; - if ((p = strrchr(dev, '/')) != NULL) - dev = p + 1; slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); #endif --- ppp-2.4.1.uus.orig/scripts/README +++ ppp-2.4.1.uus/scripts/README @@ -141,3 +141,17 @@ are escaped. This may need to be modified depending on the ssh (or pseudo-tty) implementation which may differ across platforms, for further optimizations. + +------------------------------------------------------------------------ + +12. pon, poff and ip-up + +These are modified version of the pon/poff/ip-up scripts contributed by Yann +Dirson . They allow you to call "pon quick" respectively +"pon quick my-isp" to just call the provider for running you ip-up scripts in +/etc/ppp/ip-up.d. This can be useful to check for incoming/flush outgoing +mail, without the necessary delay before hangup introduced by diald or such. + +These scripts break the possibility to connect to multiple ISPs at once, so +they are included only here. + --- ppp-2.4.1.uus.orig/scripts/redialer +++ ppp-2.4.1.uus/scripts/redialer @@ -1,96 +1,69 @@ #!/bin/sh -################################################################### # -# These parameters control the attack dialing sequence. +# A chatscript that will attempt to dial multiple numbers in sequence, until +# you get connected. # -# Maximum number of attempts to reach the telephone number(s) -MAX_ATTEMPTS=10 - -# Delay between each of the attempts. This is a parameter to sleep -# so use "15s" for 15 seconds, "1m" for 1 minute, etc. -SLEEP_DELAY=15s - -################################################################### +# To use: edit /etc/peers/provider, and change the connect line to read: +# connect "/usr/local/bin/redialer" # -# This is a list of telephone numbers. Add new numbers if you wish -# and see the function 'callall' below for the dial process. -PHONE1=555-1212 -PHONE2=411 +# See below for configuration. -################################################################### +# This is a list of chatscripts to use to get connected, and (optional) +# telephone numbers to call for each of those chatscripts. # -# If you use the ppp-on script, then these are passed to this routine -# automatically. There is no need to define them here. If not, then -# you will need to set the values. -# -ACCOUNT=my_account_name -PASSWORD=my_password +# Note that in the chatscripts, you may use #NUMBER#, this will be replaced +# with the number it is calling. You might want to use this to only have one +# chatscript that is used for all numbers, or you might need multiple +# chatscripts. -################################################################### -# -# Function to initialize the modem and ensure that it is in command -# state. This may not be needed, but it doesn't hurt. -# -function initialize -{ - chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK' - return -} +PHONE1=123456789 +CHAT1=/etc/chatscripts/provider -################################################################### -# -# Script to dial a telephone -# -function callnumber -{ -chat -v \ - ABORT '\nBUSY\r' \ - ABORT '\nNO ANSWER\r' \ - ABORT '\nRINGING\r\n\r\nRINGING\r' \ - '' ATDT$1 \ - CONNECT '' \ - ogin:--ogin: $ACCOUNT \ - assword: $PASSWORD -# -# If the connection was successful then end the whole script with a -# success. -# - if [ "$?" = "0" ]; then - exit 0 - fi +PHONE2=912345678 +CHAT2=/etc/chatscripts/provider - return -} +PHONE3=891234567 +CHAT3=/etc/chatscripts/provider -################################################################### -# -# Script to dial any telephone number -# -function callall -{ -# echo "dialing attempt number: $1" >/dev/console - callnumber $PHONE1 -# callnumber $PHONE2 -} +PHONE4=789123456 +CHAT4=/etc/chatscripts/provider -################################################################### -# -# Initialize the modem to ensure that it is in the command state -# -initialize -if [ ! "$?" = "0" ]; then - exit 1 -fi +PHONE5=001234567 +CHAT5=/etc/chatscripts/provider +# How long to sleep between retries: # -# Dial telephone numbers until one answers -# +# Note that this is a parameter to sleep so use "15s" for 15 seconds, +# "1m" for 1 minute, etc +SLEEP_DELAY=1s + +# The code below does the dialing. + attempt=0 while : ; do - attempt=`expr $attempt + 1` - callall $attempt - if [ "$attempt" = "$MAX_ATTEMPTS" ]; then - exit 1 - fi - sleep "$SLEEP_DELAY" + attempt=`expr $attempt + 1` + NUMBER=`eval echo '$PHONE'$attempt` + CHAT=`eval echo '$CHAT'$attempt` + if [ ! "$CHAT" ]; then + attempt=0 + else + logger "Dialing attempt number: $attempt" + sed s/#NUMBER#/$NUMBER/ $CHAT >/etc/chatscripts/tmpchat + /usr/sbin/chat -v -f /etc/chatscripts/tmpchat + rm -f /etc/chatscripts/tmpchat + case $? in + 0) logger Connection established ; exit 0;; + 1) logger chat: exit 1, see manpage for details. ; exit 1;; + 2) logger chat: exit 2, see manpage for details. ; exit 2;; + 3) logger chat: exit 3, see manpage for details. ;; + 4) logger Line busy. ;; + 5) logger No Carrier. ;; + 6) logger A call is coming. Exiting! ; exit 1;; + 7) logger No dialtone. ;; + 8) logger An error occured. Exiting! ; exit 1;; + *) logger chat: exit $?, see manpage for details. ;; + esac + logger "Waiting $SLEEP_DELAY seconds before next try." + sleep $SLEEP_DELAY + fi done --- ppp-2.4.1.uus.orig/scripts/secure-card +++ ppp-2.4.1.uus/scripts/secure-card @@ -1,4 +1,4 @@ -#!/usr/local/bin/expect -f +#!/usr/bin/expect -f # # This script was written by Jim Isaacson . It is # designed to work as a script to use the SecureCARD(tm) device. This @@ -17,14 +17,14 @@ send_user "hello, starting ppp\n" -system "stty 19200 -echoe -echo raw < /dev/cua3 > /dev/cua3" +system "stty 19200 -echoe -echo raw < /dev/ttyS3 > /dev/ttyS3" # # These are the parameters for the program. # set user Pxxxxxx set password xxxxxxx -set modem /dev/cua3 +set modem /dev/ttyS3 set dialup set timeout 60 @@ -107,5 +107,5 @@ } } -overlay -0 $spawn_id -1 $spawn_id pppd /dev/cua3 19200 192.111.187.215: \ +overlay -0 $spawn_id -1 $spawn_id pppd /dev/ttyS3 19200 192.111.187.215: \ crtscts modem defaultroute debug --- ppp-2.4.1.uus.orig/scripts/pon +++ ppp-2.4.1.uus/scripts/pon @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$1" = "quick" ] +then + touch /var/run/ppp-quick + shift +fi + +/usr/sbin/pppd call ${1:-provider} --- ppp-2.4.1.uus.orig/scripts/poff +++ ppp-2.4.1.uus/scripts/poff @@ -0,0 +1,26 @@ +#!/bin/sh + +# Lets see how many pppds are running.... +set -- `cat /var/run/ppp*.pid 2>/dev/null` + +case $# in + 0) # pppd only creates a pid file once ppp is up, so let's try killing pppd + # on the assumption that we've not got that far yet. + killall pppd + ;; + 1) # If only one was running then it can be killed (apparently killall + # caused problems for some, so lets try killing the pid from the file) + kill $1 + ;; + *) # More than one! Aieehh.. Dont know which one to kill. + echo "More than one pppd running. None stopped" + exit 1 + ;; +esac + +if [ -r /var/run/ppp-quick ] +then + rm -f /var/run/ppp-quick +fi + +exit 0 --- ppp-2.4.1.uus.orig/scripts/ip-up +++ ppp-2.4.1.uus/scripts/ip-up @@ -0,0 +1,45 @@ +#!/bin/sh +# +# $Id: ip-up,v 1.1 1997/12/16 11:37:26 phil Exp $ +# +# This script is run by the pppd after the link is established. +# It should be used to add routes, set IP address, run the mailq +# etc. +# +# This script is called with the following arguments: +# Arg Name Example +# $1 Interface name ppp0 +# $2 The tty ttyS1 +# $3 The link speed 38400 +# $4 Local IP number 12.34.56.78 +# $5 Peer IP number 12.34.56.99 + +# The environment is cleared before executing this script +# so the path must be reset +PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin +export PATH +# These variables are for the use of the scripts run by run-parts +PPP_IFACE="$1" +PPP_TTY="$2" +PPP_SPEED="$3" +PPP_LOCAL="$4" +PPP_REMOTE="$5" +export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE + +# as an additional convienince, $PPP_TTYNAME is set to the tty name, +# stripped of /dev/ (if present) for easier matching. +PPP_TTYNAME=`/usr/bin/basename "$2"` +export PPP_TTYNAME + +# Main Script starts here + +run-parts /etc/ppp/ip-up.d + +# if pon was called with the "quick" arg, stop ppp now +if [ -r /var/run/ppp-quick ] +then + wait + /usr/bin/poff +fi + +# last line --- ppp-2.4.1.uus.orig/scripts/callback-client +++ ppp-2.4.1.uus/scripts/callback-client @@ -0,0 +1,9 @@ +#!/bin/sh +# Script callback-client +# Script parameters: delay time in seconds + +DELAY="$1" + +/usr/sbin/chat -v -t 2 "" \d+++\d\c OK ATH0 OK +sleep $DELAY +/usr/sbin/chat -v "" ATZ OK "" RING ATA CONNECT --- ppp-2.4.1.uus.orig/scripts/callback-server +++ ppp-2.4.1.uus/scripts/callback-server @@ -0,0 +1,12 @@ +#!/bin/sh +# Script callback-server +# Script parameters: delay time in seconds, callback number +# +# If you have a very old PBX, change ATDT to ATDP ! + +DELAY="$1" +NUMBER="$2" + +/usr/sbin/chat -v -t 2 "" \d+++\d\c OK ATH0 OK +sleep $DELAY +/usr/sbin/chat -v "" ATZ OK ATDT$NUMBER CONNECT \ No newline at end of file --- ppp-2.4.1.uus.orig/SETUP +++ ppp-2.4.1.uus/SETUP @@ -21,7 +21,7 @@ that you will be dialling. For example, suppose the file is called /etc/ppp/peers/isp. This file would contain something like this: -cua0 # modem is connected to /dev/cua0 +ttyS0 # modem is connected to /dev/ttyS0 38400 # run the serial port at 38400 baud crtscts # use hardware flow control noauth # don't require the ISP to authenticate itself --- ppp-2.4.1.uus.orig/debian/patches/028-cbcp-readmes.diff +++ ppp-2.4.1.uus/debian/patches/028-cbcp-readmes.diff @@ -0,0 +1,643 @@ +diff -Naur ppp-2.4.1/README.CBCP.en ppp-2.4.1-CBCP/README.CBCP.en +--- ppp-2.4.1/README.CBCP.en Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/README.CBCP.en Fri Sep 8 12:11:24 2000 +@@ -0,0 +1,165 @@ ++First of all sorry for my English! ++My mother tongue is Hungarian. ++If anything isn't clear for you write me! ++I think you find grammar mistakes in this file. If you understand my think, ++please write me the correct sentences. ++I am not a good translator! :-) Sorry. ++ ++1. Compiling ++- Default IPX_CHANGE and CBCP_SUPPORT define is set. ++- In older kernel versions / kernel < 2.2.0 / #define PPP_CBCP line is missing ++ from pppdefs.h file which is in the include directory, so cbcp.c won't be ++ compiled succesfully. The reason is: pppdefs.h file is situated in the 'net' ++ directory of ppp package but the compiler will use the kernel header file with ++ same name in which the #define PPP_CBCP line can't be found. ++ ++2. Install: ++- from rpm: ++ Before install the rpm, please remove the original ppp package, because this ++ CBCP isn't an official part of the ppp (yet). That's why there isn't newer ++ version number. We always patch the official ppp, if we have enough time. ++ You shouldn't try upgrade with rpm -U. ++ If you try it before uninstall original ppp package, you will get "conflict" ++ with original package. So use --force parameter or rpm -e ppp-original.rpm ++ remove ppp package. ++ ++ WARNING !!! ++ Don't forget to backup your files (eg. options) from /etc/ppp directory! ++ If you do, you must reinvent the parameters of your PPP connection. ++ ++ After you installed our package by rpm -ih ppp-x.y.z-cbcpx.rpm, please check ++ /usr/doc/ppp-x.y.z directory because there are some files which are very ++ important for CBCP, like callback-server, -client and -users files. ++ Callback-users file is situated in the sample subdirectory, others are in ++ the scripts subdir. ++ Copy them to /etc/ppp directory! I don't know why this is the default place ++ for important files eg. ip-up, auth-up, options etc. But this is the RH ++ standard. :-( ++ I put some options file in the sample directory. I hope these are very usefull ++ examples what I use in my place. These files: options.autoppp for mgetty ++ /AutoPPP/ function and options.ttyS1.ipx for different IPX network numbers. ++ ttyS1 is the 2nd. serial interface. Don't forget remove .ipx from the end ++ of the filename. ++ ++- from source tgz package: ++ - use the 'make insatall' command. After that you can find three more files ++ in the /etc/ppp directory: ++ - /etc/ppp/callback-client - script which is waiting for callback by server ++ - /etc/ppp/callback-server - script which is calling back the client ++ - /etc/ppp/callback-users - user - callback mode relation. ( no callback, ++ callback fix place and callback to user given number) ++ - If the modem needs any special initialization to do the callback procedure ++ (initiate or receive) then you have to edit the callback-client and ++ callback-server scripts. ++ The first parameter of the script is always a timer value in seconds what was ++ given by CBCP as a waiting period before the callback starts. The second ++ parameter of the server script is the telephone number what we need call to ++ reach the client who initiated the connection. ++ ++3. Usage: ++- pppd asks the callback. Then the parameter is the telephone number on which ++ the server can call back us. The number will only be used in that situation if ++ the remote end is able to accept our callback asking and it asks the callback ++ number. /In Admin defined situation - of cource - the number won't be used ++ although callback happened./ You can use not only numbers but any other modem ++ commands like AT commands. For example: P01WT1234567. ++- pppd doing callback. Then we have to give 'server' text after the 'callback'. ++ There are two possibilities which depends on we want authentication or not: ++ - if we don't want auth and we want callback then the pppd always uses the ++ number which was given by user who wants to be called back. ++ - if there is auth the program uses /etc/ppp/callback-user file to check ++ whether the given user has to callback or hasn't and what is the number. ++ Default who isn't in the list the server won't callback. ++ Structure of the file: ++ ++ username option ++ ++ In the username string the * and ? wildcard characters can be used but the ++ most strict hit will be used! ++ Option: ++ - if it is missing or * then the phone number is user definied ++ - if - no callback ++ - any other situations mean Admin definied and the other value is the number ++ what we must call back. ++ ++ Examples: ++ * * ++ pro* - ++ pro12 4567890 ++ ++ Default everyone will be called back /* user, * option/, but the users whose ++ ID starts 'pro' won't /pro* user, - option/, except 'pro12' user who will be ++ called back at 4567890. ++ The program can interpret correctly the 'us*deve??01' expression, too. :-) ++ (Be carefull! This part of the program doesn't work correctly. Check before ++ use.) ++ ++4. Errors and its repair: ++- if the pppd was started by the 'callback server' parameters then we can get ++ the next messages in the log and the pppd exit: ++ Jul 22 08:41:36 haziko pppd[2886]: Callback with ++ Jul 22 08:41:36 haziko pppd[2886]: tcgetattr: Input/output error(5) ++ Jul 22 08:41:37 haziko pppd[2886]: Exit. ++ This malfunction always happen if the modem of the server side drops the ++ connection when ppp hasn't exited yet from the communication loop. Lack of ++ something better in this situation the port closing and reopening is the ++ medicine. / Corrected 98.07.21. - main.c. / ++ ++ If the CBCP don't get the indirect acknowledge for CBCP_ACK message, ++ it is susceptible to send more, the callback_in_progress variable ++ will always be put back. This variable is used to notify that after ++ exiting from the communication loop a callback will be executed. ++ Another problem: if the CBCP hadn't got any ack then closed the ++ connection after a while but at this time CBCP went back the callback ++ loop. / Corrected 98.07.25 - cbcp.c. / ++ ++ Problem has arisen that the user which was taken from the callback-user file ++ hasn't found by the system. For this problem checking the 'debug' command ++ writes the searched user's name, the most similar to and found item, precision ++ of hit and the option which is belonged to it in the log file. ++ ++Notices about NT4 RAS (Remote Access Server) with CBCP: ++ Please give me some time! ++ In this situation Linux is a CBCP client with "callback tel_num" parameter ++ and NT4 RAS is the CBCP server. ++ The most important: use "receive-all" option and m$-chap extension, plus our ++ CBCP patch, of course! :-) ++ Don't forget chap-secrets, too. ++ I will put here my first test options file to connect NT RAS with CBCP. ++ This was a very brief How-To for NT RAS. ++ If you found next situation, please use "receive-all" parameter: ++ - In the 2nd part of the callback process when NT RAS initiates the dial, Linux ++ gets a lot of "Bad FCS" packets and after 10th LCP reguests, connection will ++ be failed. ++ NT receive the LCP requests from Linux correctly, according to ppp.log. ++ ++Bugs: ++ - When NT client don't want callback but Linux CBCP server offer it, connection ++ will be dropped, silently. I don't know why. Logs are under processing. ++ - When NT client doesn't want callback from Linux CBCP server, Linux sets ++ delay to 0 instead of 5s. This is not too serious, because 0s means about ++ 4-6s delay between drop the line at the end of 1st phase and starts to ++ dial-out at the start of 2nd phase. We are working on this bug. ++ - This CBCP patch works with W2K in client mode. I have made a small test with ++ RC2 English. ++ Please don't use any M$ specific security options like Kerberos, M$-CHAP2! ++ Firstly use plain text passwords with PAP for the beginning. I haven't ++ tested any other W2K version like W2K RAS, yet. ++ If you have any more experiences with it, tell me. ++ - Wildcard character processing bug. See above. ++ - If you use with kernel 2.0.x, you can get some strange messages in the log. ++ These are not too serious. Eg. IPX_DLITF. You can ignore them, this comes ++ from the original 2.3.1[01]. ++ I advice you, use kernel 2.2.x if you can. I used 2.3.10-CBCP with kernel ++ 2.0.35 half a year without any bigger trouble. ++ ++Any comment, opinion or bug-report / oh no ;-) / would be appreciated. ++ ++Our addresses are: ++Programmer: ++Zsolt Horvath ++horzsol@freemail.hu ++ ++Tester: ++Attila Ruzsinszky ++aruzsi@freemail.hu +\ No newline at end of file +diff -Naur ppp-2.4.1/README.CBCP.hu ppp-2.4.1-CBCP/README.CBCP.hu +--- ppp-2.4.1/README.CBCP.hu Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/README.CBCP.hu Fri Sep 8 12:11:24 2000 +@@ -0,0 +1,172 @@ ++Ha valami nem tiszta, irj! ++Ha atolvasod az angol nyelvu iromanyaimat is es talalsz benni nyelvi hibakat, ++ird meg nekem, kijavitom. ++ ++Nehany szo a fejlesztesrol. ++ ++1. Forditas: ++- Alapertelmezesben be van allitva az IPX_CHANGE es CBCP_SUPPORT define. ++- A régebbi kerneleknél /kernel-verzió < 2.2.0 / a pppdefs.h-bol alapban ++ hianyzik a #define PPP_CBCP sor, emiatt a cbcp.c sajnos nem fordul. ++ A hiba oka, hogy bar a ppp csomag net konyvtaraban levo pppdefs.h-ban ++ szerepel, de a fordito az azonos nevu kernel header filet hasznalja, ++ abban viszont ez nincs meg... ++ ++2. Telepites: ++rpm-bol: ++ Mielott installalod ezt az rpm-et, tavolitsd el az eredeti ppp csomagot, ++ mert ez a CBCP kiegeszites (meg) nem resze a hivatalos ppp forrasnak, ++ ezert nem is kap ujabb verzioszamot. Mi mindig megproblajuk megpatch-elni az ++ ujabb ppp-ket, ha az idonk engedi. ++ Ebbol kifolyolag ne probobald meg upgradelni a hivatalos ppp csomagot az ++ rpm -U paranccsal, mert nem fog sikerulni. ++ Ha megis ezzel kezdted, akkor "konfliktus" lesz az eredmenye az elobbiek miatt. ++ Ha upgradelni akarsz, hasznald a --force parametert. Egyebkent eloszor az ++ rpm -e ppp-original.rpm (ahol az original az aktualis x.y.z verziot jelenti) ++ paranccsal tavolitsd el a mar fennt levo ppp csomagot es utana installald fel ++ a CBCP-s ppp-t. ++ ++ FIGYELEM !!! ++ Ne felejtsd el elmenteni, vagy lemasolni a /etc/ppp-ben levo file-okat! ++ Ha elfelejtetted, akkor ismet talahatod ki kedvenc internet szolgaltatod ++ parametereit. ++ ++ Azutan hogy az rpm -ih ppp-x.y.z-cbcpx.rpm paranccsal felinstallaltad a ++ csomagot, kerlek nezz bele a /usr/doc/ppp-x.y.z konyvtarba, mert itt talalhato ++ nehany a CBCP szamara nelkulozhetetlen file, script, mit callback-server, ++ -client, -users. A callback-users a sample alkonyvtarban, a tobbiek a scripts- ++ ben. ++ Masold oket a /etc/ppp-be! Nem tudom, hogy miert ez a szabvany az RH-nal es ++ miert ide a /usr/doc/ppp ala teszik a fontos file-okat, mint pl. ip-up, ++ auth-up stb. De ez a szabvany, mi pedig nem akartunk ez ellen veteni. ++ A sample alkonyvtarba betettem nehany sajat hasznalatu options file-t, mint ++ options-autopp ami az mgettz /AutoPPP/ funkciojahoz keszult es ezekkel a ++ parameterekkel hivodik meg a pppd, ill. az options.ttyS1.ipx minta file-t, ++ ami a kulonbozo IPX network number-ek beallitasat vegzi a ttyS1-es soros ++ vonali interfeszen. Ahhoz, hogy ezen utobbi file-t a pppd haszalni is tudja, ++ a vegerol a .ipx elhagyando. ++ ++forras tgz-bol: ++ - a make install parancssal tortenik. A telepites soran a szokasos ++ allomanyokon kivul telepitesre kerul tovabbi harom allomany az /etc/ppp ++ konyvtarba: ++ - /etc/ppp/callback-client - a script visszahivast var a szervertol ++ - /etc/ppp/callback-server - a script a kliens visszahivasat vegzi. ++ - /etc/ppp/callback-users - fehasznalo - visszahivasi mod kapcsolat ++ - ha a modem valamilyen specialis inicializalast igenyel a visszahivas ++ elvegzese- vagy fogadasa eseten, akkor a callback-client/callback-server ++ script parost kell javitani. A ket script elso parametere mindket esetben ++ az az ertek masodpercben, amelyet a CBCP megadott, mint visszahivas elotti ++ varakozasi ido. A szerver script masodik parameterkent a visszahivando ++ szamot kapja meg. ++ ++3. Hasznalat: ++- a pppd visszahivast ker. Ekkor a callback parameter jarulekos parametere a ++ telefonszam, amlyen a szerver vissza tud hivni. A szam tenylegesen csak ++ akkor kerul felhasznalasra, ha a tuloldal fogadja a visszahivasi kerelmet ++ es a hivotol keri a visszahivando szamot. / Admin definied esetben - ertelem ++ szeruen - a szam nem kerul felhasznalasra, noha visszahivas tortenik. / ++ Telefonszamkent nem csak szamjegy adhato meg, tehat megadthato pl. ++ P01WT1234567 is. ++- a pppd visszahivast vegez. Ekkor a callback utan a server szoveget kell ++ megadni. A visszahivas eseten tovabbi ket lehetoseg van attol fuggoen, ++ hogy eloirtunk-e authentikaciot. ++ - ha nem kertunk autentikhaciot, de eloirtuk a visszahivast, akkor mindig ++ a felhasznalo altal megadott szamon hiv vissza a pppd. ++ - authentikacio eseten az /etc/ppp/callback-users file-bol veszi, hogy a ++ megadott usert vissza kell-e hivni, illetve milyen szamon. ++ Alapertelmezesben aki nem szerepel a fileben, azt a szerver nem hivja ++ vissza. A file felepitese: ++ usernev opcio ++ Az usernevben * es ? is szerpelhet, de mindig a legpontosabb talalat ++ szamit. ++ Opcio: ++ - ha nincs megadva, vagy *, akkor user definied ++ - ha -, nincs visszahivas, ++ - egyeb ertek eseten admin definied, az egyeb ertek a visszahivando szam. ++ Pl.: ++ * * ++ pro* - ++ pro12 4567890 ++ Alapban mindenkit visszahiv /* user, * opcio/, de a pro-val kezdodo ++ usereket nem /pro* user, - opcio/, kiveve a pro12 user, aki a 4567890 ++ szamon hivando vissza. ++ A program helyesen ertelmezi a us*deve??01 kifejezest is. ;-) ++ (Legy ovatos! A program ezen resze sajnos bugos. Ellenorizd, mielott ++ hasznalod!) ++ ++4. Hibak es javitasuk: ++- ha a pppd callback server parameterrel indul, akkor elofordulhat, hogy ++ a kovetkezo hibauzenettel kilep: ++ Jul 22 08:41:36 haziko pppd[2886]: Callback with ++ Jul 22 08:41:36 haziko pppd[2886]: tcgetattr: Input/output error(5) ++ Jul 22 08:41:37 haziko pppd[2886]: Exit. ++ A hiba mindig akkor lep fel, ha a szerver oldali modem bont, amikor a ppp ++ meg nem lepett ki az adattovabbito ciklusbol. Jobb hijan ilyenkor a port ++ lezarasa es ujranyitasa a gyogyszer ra. / Javitva 980721 - main.c. / ++ ++ A CBCP ha nem kapja meg a kozvetett nyugtat a CBCP_ACK uzenetre, ++ hajlamos azt tobbszor is elkuldeni, igy mindig visszaalitva a ++ callback_in_progress valtozot, amely azt hivatott jelezni, hogy az ++ adattovabbito hurokbol valo kilepes utan viszzahivas tortenik. ++ Szinten problemat okozott, hogy ha semmilyen nyugtat nem kapott, ++ akkor egy ido utan lezarta a kapcsolatot, de ekkor is belepett a ++ visszahivasi hurokba. / Javitva 980725 - cbcp.c / ++ ++ Felmerult problema, hogy a callback-user filebol vett felhasznalo ++ eseten nem mindig talalja meg a keresett felhasznalot. A hiba ++ ellenorzese erdekeben a debug parancs hatasara a rutin log-ba irja ++ a keresett felhasznalo nevet, az ehhez legjobban hasonlito, altala ++ megtalalt bejegyzest, a talalati pontossagot, valamint az ehhez ++ tartozo opciot. ++ ++Megjegyzesek az NT4 CBCP-s RAS-rol: ++ Reszletesebb kidolgozashoz tobb ido kellene. ++ ++ Ebben a szituacioban a Linux a CBCP kliens, aki a "callback tel_num" ++ parametert hasznalja, mig az NT4 RAS a CBCP szerver. ++ A legfontosabb a mukodeshez: a "receive-all" parameter, az m$-chap tamogatas ++ a pppd-be es termeszetesen a mi CBCP patch-unk. ++ Ne feledd a chap-secrets file helyes kitolteset sem! ++ Ide fogom tenni az elso sajat options file-omat, amivel sikerul a csatlakozas ++ a CBCP-s NT RAS-hoz. ++ Ez egy nagyon rovid How-To volt az NT-s csatlakozashoz. ++ Ha az alabbi szituacioval talalkozol, akkor hasznald a "receive-all"-t: ++ - A CBCP 2. fazisaban, amikor az NT visszahiv, a Linux "Bad FCS"-es LCP ++ kereseket vesz az NT-tol es igy a 10. sikertelen keres utan a kapcsolat ++ bontodik. ++ Az NT hibatlan LCP kereseket vesz a Linuxtol a ppp.log szerint. ++ ++Bug-ok: ++ - Amikor az NT kliens nem akar visszahivast a Linuxos CBCP szervertol, a ++ kapcsolat szinten elbomlik. Egyenlore nem tudjuk miert. A logok elemzese ++ folyamatban. ++ - A Linux CBCP-ben levo bug miatt a Linux az NT RAS visszahivasi idoziteset ++ 0-ra allitja, a default 5s helyett. Nem veszelyes, mert a 0s mellett is ++ kb. 4-6s lesz az 1. fazis bontas es 2. fazis tarcsazas kozott. Dolgozunk ++ rajta. ++ - A CBCP megy a W2K klienssel. Az RC2-es angol verzioval tettem egy probat. ++ Az elso probak soran ne hasznalj semmilyen M$ specifikus titkositast, ++ mint Kerberos, M$-CHAP2 stb. Kezdeskor mindig legyen kodolatlan jelszo ++ PAP protokollal, majd ha mar megy, lehet tovabb finomitani a biztonsagot, ++ ha a Linux is ismeri oket. ++ Barmilyen tovabbi eszrevetel is erdekelne. W2K egyeb verzioit nem ++ teszteltem, mint pl. W2K RAS. ++ - Wildcard karakterek feldolgozasa bug-os. Lasd feljebb. ++ - Ha 2.0.x-es kernellel hasznalod, nem vart hibauzenetek kerulhetnek a log-ba. ++ Ezek nem tul komolyak, mint pl. IPX_DLITF. Eltekinthetsz toluk, mert ezek ++ az eredeti 2.3.1[01]-es ppp-tol jonnek 2.0.x-es kernelek alatt. ++ Azt tanacsolom, hogyha csak teheted, terj at a 2.2.x-es kernelre, bar ettol ++ fuggetlenul a CBCP megy a 2.0.x-essel is. En fel evig hasznaltam nagyobb ++ hiba nelkul. ++ ++Az esetleges eszreveteleket, velemenyeket, esetleg bug-reportot / oh no ;-) / ++ide kerem: ++ ++Programozo: ++Horvath Zsolt ++horzsol@freemail.hu ++ ++Tesztelo: ++Ruzsinszky Attila ++aruzsi@freemail.hu +\ No newline at end of file +diff -Naur ppp-2.4.1/README.CBCP.install.en ppp-2.4.1-CBCP/README.CBCP.install.en +--- ppp-2.4.1/README.CBCP.install.en Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/README.CBCP.install.en Fri Sep 8 12:11:24 2000 +@@ -0,0 +1,119 @@ ++Some words about installing PPP with CBCP. ++ ++This CBCP client and server extension for PPP was tested in Linux and Win9x, but it isn't "closed out" working with another client programs which implements CBCP. ++Clients which hasn't tested, yet: ++Win3.1x Wfw, ++Trumpet Winsock, ++FTP OnNet, ++Novell Client ++MacIntosh etc. ++ ++The basic working condition of clients that must support CBCP protokol, which is an extension of the LCP definied in RFC1570. Another condition is the knowledge of PAP and/or CHAP authentication protocols. Now is possible to use CBCP without those auth. protocols, but in the future, PPP won't accept CBCP without authorization! ++I'm sorry, but I don't know this kind of client programs, except Win9x, NT, (maybe Y2) and Linux, or other Unix platforms which use our patch. If you found them, used them and they work with our CBCP patch, notice me and I will modify this README. I'm interested in hearing any operating sytem which supports our CBCP implementation. ++ ++I just tested the NT as client, because of my NT4.0 RAS didn't send back any packets to my Linux box! :-(( If you have any experience with NT RAS, please help me, or try to test our Linux client with CBCP. ++ ++CBCP which was implemented by Zsolt Horvath the SERVER means: ++Linux realizes callback. So it executes the callback if the given user has permission and the authorization is enabled. If there is no authentication, anyone will called back if he or she wants it! ++CLIENT means: ++Linux asks a CBCP server to callback it. PPP is able to work both mode on the same machine, but not for the same pppd process. In this situation you must give parameters or use different options file to setup pppds for incoming and outgoing calls. For example: There are two phone line. One of the is used for incoming calls. The other used for outgoing calls to Internet. The ISP uses NT RAS to accept calls and use admin defined callback to control the client who is able to surf on the Net. In this situation if a user try to connect our Linux box has to start two pppd. One in server mode with "callback server" parameter executing the user asked callback, and another with "callback phone_no" to initiate a callback request from NT RAS. ++Because I don't have almost any experience in Linux-Linux CBCP connection (yet), please send me your question and I will pass to the programmer, my friend Zsolt Horvath. ++ ++And now the substance, Win9x or NT with CBCP. ++ ++The first condition is there must be a correctly working Win9x (NT)- Linux PPP connection without CBCP. It means, the PPP works perfectly both side. ++If you don't know how can setup Dial-up Networking with Win9x (NT), ask me! I think it would be a little longer than this file, but I started writting that in HTML, full of images. :-) ++On the Win9x client side there is nothing to configure or modify. ++The Win tries CBCP by default and if the server accept it the connection will be succesfull with CBCP. ++On the Linux there are three new file, which must be in the /etc/ppp directory. These are: ++ ++1. callback-server script: ++Owner: root.root ++Permission: rwx------ ++It gets two parameters: First, in how many secs starts the dialing to the CBCP- The second is the phone number what has to dial to reach the client, but it can consists of any AT commands without the AT prefix tag. For example: 00W06W123-4567, where the "W" means: the modem waits a given secs for dial tone. ++ ++2. callback-client script: ++Owner: root.root ++Permission: rwx------ ++It gets one parameter: callback delay time in secs. ++ ++3. callback-users file: ++Owner: root.root ++Permission: rw------- ++User rattila disabled from CBCP: rattila - ++User will be called back at fix number: rattila 76-42 ++User can give the number for CBCP: rattila * ++ ++In that file can be used wildcard characters (? *) and the system uses the best fit pattern. ++CAUTION! There is a bug somewhere in this subroutine so don't forget checking who will be called back before you put that characters in your callback-users file! If your system doesn't use PAP or CHAP authentication protocols, everyone will be called back, who wants it! ++So be carefull with pppd parameters eg. auth +pap -chap login. ++Restriction: the callback always initiates through that modem on which the CBCP was asked, so the user can't specify which modem used for callback, dynamically. ++ ++The CBCP protocol will be accepted after the required authentication protocol. So user should use one of the auth. protocol (PAP, CHAP), but if you are the administrator, never entrusts it to users! ++I use this setting: PAP with login option. In this situation the user is able to use PPP connection with his normal username and password pair. Then in the Dial-up networking window of Win9x must specify username and password, has to switch off the encrypted password requirement option and don't choose saving password, if you don't use alone the computer. ++I don't have any succesfull experience, because PAP and login are more convenient than CHAP. Later, I will make some test with CHAP and M$-CHAP protocols. ++ ++The checking of PAP or CHAP will be done after callback, but Win9x ask nothing again because all data is available for the newly initiated authentication. ++ ++One possible solution: ++mgetty+autoPPP ++ ++1. First of all install mgetty and our PPP package with CBCP extension, if there isn't on the machine, yet. ++2. Setup the mgetty for answer incoming calls. See man mgetty! ++ Don't forget modify mgetty.conf as your modem require. ++ Check the modem AT commands. ++ To start watching incoming calls by mgetty, modify inittab. ++ After modified config files, use init q. ++3. Modify login.config file: ++ /AutoPPP/ - a_ppp /usr/sbin/pppd file /etc/ppp/options.autoppp ++4. Fill up /etc/ppp/options.autoppp, like: (example) ++ auth ++ -chap ++ +pap ++ login ++ proxyarp ++ modem ++ lock ++ ipx ++ #debug ++ callback-server ++ ++ "auth" asks client authentication, ++ "-chap" refuse CHAP auth. protocol ++ "+pap" require PAP auth. protocol ++ "login" PAP uses normal username/password pair from /etc/passwd. ++ With this no need to store more than once passwords, so put just one line in the pap-secrets file: ** "" * ++ "proxyarp" the server side pppx interface (local) IP address will be the IP address of the first LAN card (eth0). See man pppd. ++ "modem" I think this option self-evident. We use modem not direct cable connection. ++ "lock" use the same locking mechanism, as mgetty. ++ "ipx" if you want use IPX protocol, too. Why not? ++ "debug" if something is not good and wants to put more info in the log. BE CAREFULL! The plain password can be read in the log if you don' disable it. ++ "callback-server" accept CBCP requies from the client and it will called be back, if there is in the callback-users file. See callback-users file. ++ ++If you use this exmaple options.autoppp file you must explicite setup IP address for clients, otherwise the connection will be failed. See Win9x Dial-up networking -> Server types -> TCP/IP options -> IP address. ++If there is a given IP address for every machine which connected your network by modem from the private IP address range eg. 192.168.x.y, then it is simplify DNS definition and log analyse. Think about firewall and proxy rules! ++5. /etc/ppp/pap-secrets: ++ That's all you nedd to put into: ++ * * "" 192.168.x.0/24 ++ ++ You must specify an IP address range after PPP 2.3.5. ++ If you don't give, connection will be failed. ++ ++ ++I use these options, parameters and it is working correctly. ++I wish you pleasant PPP connections! ++ ++If you have any experience in these topics: ++CHAP with Win9x, ++M$-CHAP with Win9x, NT. ++Making packages from one PPP source with our CBCP patch with least work (Debian, RH, SuSE, etc.), ++Using any other operating systems with CBCP (DOS, Win3.1x Wfw, etc.). ++ ++If you interested in using IPX with PPP, I can give you my config. ++ ++Any comments would be appreciated! ++If you understood my thought but the grammar is terrible, please correct me! ++Bye: ++ ++Attila Ruzsinszky ++aruzsi@freemail.hu +\ No newline at end of file +diff -Naur ppp-2.4.1/README.CBCP.install.hu ppp-2.4.1-CBCP/README.CBCP.install.hu +--- ppp-2.4.1/README.CBCP.install.hu Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/README.CBCP.install.hu Fri Sep 8 12:11:24 2000 +@@ -0,0 +1,168 @@ ++ ++Nehany szo a CBCP-s PPP kapcsolat installalasarol. ++ ++Ez a Linuxon futo CBCP szerver es kliens PPP protokol kiegeszites egyenlore csak ++Win9x es Linux alatt lett tesztelve, de nem kizart, hogy mas a CBCP-t megvalosito ++klienssel is hasznalhato. ++Ezen nem kiprobalt kliensek: ++Win3.1x Wfw, ++Trumpet Winsock, ++FTP OnNet, ++Novell Client stb. ++ ++A kliensek alapveto mukodesi feltetele, hogy tamogasak a CBCP protokollt, amely ++az LCP kiterjesztesekent az RFC1570-ben van definialva. Tovabbi feltetel a PAP ++es/vagy CHAP azonositasi protokollok ismerete, mert bar jelenleg lehetoseg van ++azonositas nelkul is visszahivast kerni, de ez a jovoben valtozni, azaz nem lesz ++visszahivas authentikacio nelkul! ++Sajnos ilyen kliens programokrol nem tudok. Amennyiben ilyenek felbukkananak ++valakinel es eljutatja hozzam, szivesen kiprobalnam, amint lesz eleg idom. ++ ++Ezuton kernek mindenkit, hogy jelezze szamomra, milyen PPP-s programok leteznek ++Win3.x, Novell Client, MacIntosh es estleg DOS ala, valamint azok elerhetoseget. ++WinNT-n egyenlore csak mint kliens teszteltem, mert az NT-s RAS egyaltalan nem ++kommunikal a behivo Linux klienssel. (a kiserletek tovabb folynak) ++Szivesen vennem az ilyen iranyu kiserleteket, tapasztalatokat, segitseget! ++ ++A CBCP protokollhoz keszult Horvath Zsolt altal megvalositott ++CBCP szerver es kliens implementacional: ++a SZERVER azt jelenti, hogy a Linux valositja meg a visszahivast, tehat o ++kezdemenyezi a kliens visszahivasat, aszerint, hogy a usernek van-e joga a ++visszahivasra, vagy se, ha az azonositas engedelyezve van. ++a KLIENS azt jelenti, hogy o keri a CBCP szervert, hogy hivja vissza. ++Tehat a Linux mindket modban mukodhet, akar egyszerre is, bar ekkor a pppd-t ++meghivasa elott parameterezni kell, vagy kulonbozo options-t kell hasznalni a ++ki- es behivashoz, mivel szerepelni kell az options-ban szervernel (behivaskor) ++a "callback server", mig kliensnel a "callback tel_szam" parametereknek. Igy ++elkepzelheto az az eset, hogy egy Linuxos szervertol a behivo user ker ++visszahivast a telefonszamla csokkentese miatt, ugyanakkor ez a Linuxos gep az ++Internetes elereshez egy WinNT-hez csatlakozik, amely ugy ellenorzi a hozza ++modemen csatlakozo gepeket, hogy visszahivja oket, amely esetben a Linuxnak a ++csatlakozashoz CBCP kliensnek kell lennie. ++Mivel ahogy az elejen mar emlitettem Linux-Linux kapcsolattal (meg) nem probalkoztam, ++ezert ezugyben forduljatok Horvath Zsolthoz! ++ ++Es akkor most a lenyeg, Win9x visszahivassal (amely igaz NT kliensre is). ++ ++Az elso feltetel, hogy a Win9x-Linux PPP-s kapcsolat HIBATLANUL mukodjon meg a ++CBCP elott, azaz a CBCP nelkuli pppd-vel mukodjon a behivas. ++Egyenlore ezt itt nem reszleteznem, de ha igeny jelentkezik erre, beveszem ebbe ++a dokumentumba (vagy inkabb egy HTML oldalba). ++A Win9x-nel kliens oldalan a CBCP-hez SEMMIT nem kell modositani, vagy beallitani! ++A Win alapban megprobalja hasznalni a CBCP-t es ha a szerver ezt elfogadja, ++akkor meg is valosul a visszahivas. ++Linuxon harom uj file kerul felhasznalasra, amelyeknek a /etc/ppp konyvtarban ++van a helyuk, hasonloan a tobbi PPP-hez szukseges file-hoz. Ezek: ++ ++1. callback-server script: ++Tulaj: root.root ++Jogok: rwx------ ++Ket parametert kap. Az elso hogy hany masodperc mulva kezdje meg a tarcsazast a ++visszahivashoz. A masodik a visszahivando szam, de tartalmazhat modem AT parancsokat ++is az AT kiirasa nelkul. Pl.: 00W06W123-4567, ahol a "W" azt jelenti, hogy adott ++ideig varakozzon tarcsahanga. ++ ++2. callback-client script: ++Tulaj: root.root ++Jogok: rwx------ ++Egy parametert kap, az idozitesi parametert. ++ ++3. callback-users file: ++Tulaj: root.root ++Jogok: rw------- ++A user - rattila - kitiltva a visszahivasbol: rattila - ++A user visszahivasa fix szamra: rattila 76-42 ++A user adhatja meg a visszahivando szamot: rattila * ++ ++Ebben a file-ban hasznalhatok a joker karakterek (? *) es a rendszer a legjobban ++illeszkedo mintat fogja hasznalni. ++FIGYELEM! Ez a programresz meg bugos, igy ellenorizendo, mielott elesben hasznalna ++valaki. Probaljuk ki, nem hiv-e vissza olyan user-t is, akit nem kellene! ++PAP, ill. CHAP azonositas nelkul BARKIT visszahiv, igy csak fokozott figyelemmel ++parameterezzuk a pppd-t. Pl: auth +pap -chap login. ++Korlatozas: a visszahivas mindig azon a modemen keresztul tortenik, amelyen a ++visszahivast kertek, tehat a visszahivaskor nem adhato meg masik modem, ++dinamikusan a user altal. ++ ++A CBCP protokol elfogadasa mindig a megfelelo, vagy kert authentikacios ++protokoll utan kerul egyeztetesre. Igy a usernek illdomos hasznalni valamelyik ++authentikacios protokolt (PAP, CHAP), de ezt ne bizzuk a userre! ++En a kovetkezo beallitast hasznalom: PAP protokol a login opcioval. Igy a user ++a normal azonositojaval es jelszavaval hasznalhatja a PPP-s kapcsolatot. ++Ekkor a Win9x telefonos halozat ablakaban meg kell adni a user nevet es a ++jelszavat, ki kell kapcsolni a kodolt jelszo keres opciot es ne X-eljuk be a ++jelszo elmenteset, ha nem egyedul hasznaljuk a gepet. ++ ++A PAP, vagy CHAP ellenorzese a visszahivas utan is megtortenik, de a Win mar ++nem kerdez semmit, mert az osszes adat a rendelkezesere all az ujboli ++authentikalashoz. ++ ++Egy lehetseges megoldas: ++mgetty+autoPPP ++ ++1. Installaljuk az mgetty es a CBCP-s PPP csomagot, ha meg nem lennenek a gepen. ++2. Allitsuk be az mgetty-t a bejovo hivasok fogadasara. Lasd man mgetty! ++ Ne feljtsd el modositani az mgetty.conf-ot a modem leirasnak megfeleloen es ++ ujrainditani az mgetty processzt(eket) az uj konfig hasznalatahoz (init q)! ++3. Modositsuk a login.config file-t az alabbiak szerint: ++ /AutoPPP/ - a_ppp /usr/sbin/pppd file /etc/ppp/options.autoppp ++4. /etc/ppp/options.autoppp ++ auth ++ -chap ++ +pap ++ login ++ proxyarp ++ modem ++ lock ++ ipx ++ #debug ++ callback-server ++ ++ Az "auth" keri, hogy a kliens authentikalja magat a szerver fele. ++ "-chap" a CHAP protokol kikapcsolasat, vagy elutasitasat jelenti. ++ "+pap" a PAP protokol bekapcsolasat vagy megkoveteleset jelenti. ++ "login" a user a bejelentkezeshez a normal user/password parost hasznalhatja, ++ amely a passwd allomanybol (esetleg shadow) kerul kiertekelesre. ++ Ezzel a beallitassal a pap-secrets file-ban a jelszo resz uresen marad, ++ es igy nem kell tobb helyen nyilvantartani a jelszavakat. ++ "proxyarp" a pppx interface szerver oldali (lokalis) IP cime az elso LAN kartya cime ++ lesz. Lasd meg man pppd! ++ "modem" magaert beszel, azaz modemet hasznalunk, nem direkt vonalat. ++ "lock" lock-olasi mechanizmus megadasa. ++ "ipx" ha IPX-et is akarunk atvinni az IP mellett (miert ne?) ++ "debug" ha valami nem OK, es tobb infot akarunk a log-ban ++ VIGYAZAT! A jelszo is bekerul(het) a log-ba olvashato formaban! ++ "callback-server" elfogadjuk a CBCP kerest a klienstol, es vissza fogjuk hivni, ++ ha erre joga van. Lasd callback-users file! ++ ++Ennek az options.autoppp file-nak a hasznalatanal a kliensnel MINDIG meg kell adni ++a lokalis IP cimet, kulonben a kapcsolat nem fog osszejonni. Lasd Win9x telefonos ++halozatnal a szerver beallitasai kozott azt az opciot, ahol nekunk kell megadni az ++IP cimet. ++Ha minden modemes gepnek sajat IP cimet adunk pl. a 192.168.x.y tartomanybol, ++akkor ez nagy mertekben egyszerusiti a DNS beallitasat es a log-ok kiertekeleset, ++hogy melyik geprol (IP cimrol) leptek be. Proxy, firewall beallitasok! ++5. /etc/ppp/pap-secrets ++ Osszesen ennyi kell: ++ * * "" 192.168.1.0/24 ++ ++ Az IP cim vagy cimtartomany megadasa a 2.3.5-os PPP-nel kotelezo, az ures reszt, ++ vagy a *-ot nem fogadja el! ++ ++En ezeket a beallitasokat hasznalom mar par eve es hiba nelkul megy. ++Jo szorakozast es kevesebb telefonszamlat! ++ ++Erdekelnenek tapasztalatok: ++a CHAP-rol (Win9x, ha lehetseges egyaltalan) ++az MS-CHAP-rol (WinNT) ++Linux-Linux kapcsolatrol ++Debianra csomaggyartas ++mas PC-s op.rendszerek hasznalata (DOS, Win3.1x) ++ ++Akit erdekel, tudok adni infot a PPP-s IPX-hez is. ++ ++Barmilyen visszajelzest az alabbi cimre postazzatok: ++aruzsi@freemail.hu ++ ++Ruzsinszky Attila ++ --- ppp-2.4.1.uus.orig/debian/patches/022_lockfile-fix.diff +++ ppp-2.4.1.uus/debian/patches/022_lockfile-fix.diff @@ -0,0 +1,26 @@ +diff -ruN -x Makefile.in -x configure -x *~ ppp-2.4.1.orig/pppd/utils.c ppp-2.4.1/pppd/utils.c +--- ppp-2.4.1.orig/pppd/utils.c Fri Mar 16 15:28:05 2001 ++++ ppp-2.4.1/pppd/utils.c Thu Jul 12 20:26:31 2001 +@@ -819,9 +819,20 @@ + major(sbuf.st_rdev), minor(sbuf.st_rdev)); + #else + char *p; ++ char lockdev[MAXPATHLEN]; ++ ++ if ((p = strstr(dev, "dev/")) != NULL) { ++ dev = p + 4; ++ strncpy(lockdev, dev, MAXPATHLEN-1); ++ lockdev[MAXPATHLEN-1] = 0; ++ while ((p = strrchr(lockdev, '/')) != NULL) { ++ *p = '_'; ++ } ++ dev = lockdev; ++ } else ++ if ((p = strrchr(dev, '/')) != NULL) ++ dev = p + 1; + +- if ((p = strrchr(dev, '/')) != NULL) +- dev = p + 1; + slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); + #endif + --- ppp-2.4.1.uus.orig/debian/patches/029-cbcp-scripsandconf.diff +++ ppp-2.4.1.uus/debian/patches/029-cbcp-scripsandconf.diff @@ -0,0 +1,74 @@ +diff -Naur ppp-2.4.1/pppd/pathnames.h ppp-2.4.1-CBCP/pppd/pathnames.h +--- ppp-2.4.1/pppd/pathnames.h Thu Mar 8 06:15:37 2001 ++++ ppp-2.4.1-CBCP/pppd/pathnames.h Thu Jun 21 17:05:41 2001 +@@ -53,3 +53,10 @@ + #ifdef PLUGIN + #define _PATH_PLUGIN "/usr/lib/pppd/" VERSION + #endif /* PLUGIN */ ++ ++#ifdef CBCP_SUPPORT ++#define _PATH_CBCP_SERVER "/etc/ppp/callback-server" ++#define _PATH_CBCP_CLIENT "/etc/ppp/callback-client" ++#define _PATH_CBCP_USERS "/etc/ppp/callback-users" ++#define _PATH_CBCP_ "/etc/ppp/callback" ++#endif /* CBCP_SUPPORT */ +diff -Naur ppp-2.4.1/etc.ppp/callback-users ppp-2.4.1-CBCP/etc.ppp/callback-users +--- ppp-2.4.1/etc.ppp/callback-users Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/etc.ppp/callback-users Fri Sep 8 12:11:25 2000 +@@ -0,0 +1,25 @@ ++# User list file for callback ++# Username option ++# option - : no callback ++# option * or empty: user definied ++# option number : admin definied, callback to that number ++# in username * and ? are valid wildcars, callback uses the best fit ++# (There is a small bug in this subrutin in pppd, so check before use!) ++# ++# Examples: ++# zotyo 67435 # user zotyo will called back at number 67453 ++# # this is the so called admin definied option ++# gates - # gates won't call back ++# me * # Me call back any number what he gives! ++# Everyone will be called back, so explicite define who MUST ++# authencitated for callback and change below! ++ ++# If there is no any authentication protocol (PAP, CHAP), ++# anyone can use callback if he (she) wants. So don't forget ++# to give these options to pppd: +pap or +chap or both. ++# I prefer auth +pap -chap login options with mgetty. ++ ++# Be carefull! ++# If you remove the last hasmark EVERYONE is able to use CBCP! ++# Please explicite define users to enable CBCP. ++#* +\ No newline at end of file +diff -Naur ppp-2.4.1/scripts/callback-client ppp-2.4.1-CBCP/scripts/callback-client +--- ppp-2.4.1/scripts/callback-client Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/scripts/callback-client Fri Sep 8 12:11:25 2000 +@@ -0,0 +1,9 @@ ++#!/bin/sh ++# Script callback-client ++# Script parameters: delay time in seconds ++ ++DELAY="$1" ++ ++/usr/sbin/chat -v -t 2 "" \d+++\d\c OK ATH0 OK ++sleep $DELAY ++/usr/sbin/chat -v "" ATZ OK "" RING ATA CONNECT +diff -Naur ppp-2.4.1/scripts/callback-server ppp-2.4.1-CBCP/scripts/callback-server +--- ppp-2.4.1/scripts/callback-server Thu Jan 1 01:00:00 1970 ++++ ppp-2.4.1-CBCP/scripts/callback-server Fri Sep 8 12:11:25 2000 +@@ -0,0 +1,12 @@ ++#!/bin/sh ++# Script callback-server ++# Script parameters: delay time in seconds, callback number ++# ++# If you have a very old PBX, change ATDT to ATDP ! ++ ++DELAY="$1" ++NUMBER="$2" ++ ++/usr/sbin/chat -v -t 2 "" \d+++\d\c OK ATH0 OK ++sleep $DELAY ++/usr/sbin/chat -v "" ATZ OK ATDT$NUMBER CONNECT +\ No newline at end of file --- ppp-2.4.1.uus.orig/debian/patches/002_chat.c.diff +++ ppp-2.4.1.uus/debian/patches/002_chat.c.diff @@ -0,0 +1,11 @@ +--- ppp-2.4.0b4.orig/chat/chat.c ++++ ppp-2.4.0b4/chat/chat.c +@@ -203,7 +203,7 @@ + int clear_abort_next = 0; + + char *report_string[MAX_REPORTS] ; +-char report_buffer[50] ; ++char report_buffer[256] ; + int n_reports = 0, report_next = 0, report_gathering = 0 ; + int clear_report_next = 0; + --- ppp-2.4.1.uus.orig/debian/patches/030-cbcp-auth.c.diff +++ ppp-2.4.1.uus/debian/patches/030-cbcp-auth.c.diff @@ -0,0 +1,31 @@ +diff -Naur ppp-2.4.1/pppd/auth.c ppp-2.4.1-CBCP/pppd/auth.c +--- ppp-2.4.1/pppd/auth.c Tue Mar 13 06:54:33 2001 ++++ ppp-2.4.1-CBCP/pppd/auth.c Thu Jun 21 17:24:57 2001 +@@ -172,7 +172,6 @@ + + /* Prototypes for procedures local to this file. */ + +-static void network_phase __P((int)); + static void check_idle __P((void *)); + static void connect_time_expired __P((void *)); + static int plogin __P((char *, char *, char **)); +@@ -499,8 +498,7 @@ + /* + * Proceed to the network phase. + */ +-static void +-network_phase(unit) ++void network_phase(unit) + int unit; + { + lcp_options *go = &lcp_gotoptions[unit]; +@@ -520,7 +518,8 @@ + /* + * If we negotiated callback, do it now. + */ +- if (go->neg_cbcp) { ++ if (((go->neg_cbcp)||(lcp_hisoptions[ unit ].neg_cbcp)) ++ && (phase!=PHASE_CALLBACK)) { + new_phase(PHASE_CALLBACK); + (*cbcp_protent.open)(unit); + return; --- ppp-2.4.1.uus.orig/debian/patches/018_ip-up_option.diff +++ ppp-2.4.1.uus/debian/patches/018_ip-up_option.diff @@ -0,0 +1,98 @@ +--- ppp-2.4.1/pppd/ipcp.c Thu Mar 8 06:11:12 2001 ++++ ppp-2.4.1-new/pppd/ipcp.c Tue Jun 19 15:35:36 2001 +@@ -1734,7 +1734,7 @@ + */ + if (ipcp_script_state == s_down && ipcp_script_pid == 0) { + ipcp_script_state = s_up; +- ipcp_script(_PATH_IPUP); ++ ipcp_script(path_ipup); + } + } + +@@ -1777,7 +1777,7 @@ + /* Execute the ip-down script */ + if (ipcp_script_state == s_up && ipcp_script_pid == 0) { + ipcp_script_state = s_down; +- ipcp_script(_PATH_IPDOWN); ++ ipcp_script(path_ipdown); + } + } + +@@ -1828,13 +1828,13 @@ + case s_up: + if (ipcp_fsm[0].state != OPENED) { + ipcp_script_state = s_down; +- ipcp_script(_PATH_IPDOWN); ++ ipcp_script(path_ipdown); + } + break; + case s_down: + if (ipcp_fsm[0].state == OPENED) { + ipcp_script_state = s_up; +- ipcp_script(_PATH_IPUP); ++ ipcp_script(path_ipup); + } + break; + } + +--- ppp-2.4.1/pppd/main.c Tue Mar 13 06:56:19 2001 ++++ ppp-2.4.1-new/pppd/main.c Tue Jun 19 15:35:36 2001 +@@ -233,6 +233,9 @@ + struct protent *protp; + char numbuf[16]; + ++ strlcpy(path_ipup, "/etc/ppp/ip-up", sizeof(path_ipup)); ++ strlcpy(path_ipdown, "/etc/ppp/ip-down", sizeof(path_ipup)); ++ + new_phase(PHASE_INITIALIZE); + + /* + +--- ppp-2.4.1/pppd/options.c Tue Mar 13 06:56:19 2001 ++++ ppp-2.4.1-new/pppd/options.c Tue Jun 19 15:38:32 2001 +@@ -85,6 +85,8 @@ + bool dump_options; /* print out option values */ + bool dryrun; /* print out option values and exit */ + char *domain; /* domain name set by domain option */ ++char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ ++char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ + + extern option_t auth_options[]; + extern struct stat devstat; +@@ -231,6 +233,12 @@ + "Print out option values after parsing all options", 1 }, + { "dryrun", o_bool, &dryrun, + "Stop after parsing, printing, and checking options", 1 }, ++ { "ip-up-script", o_string, path_ipup, ++ "Set pathname of ip-up script", ++ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, ++ { "ip-down-script", o_string, path_ipdown, ++ "Set pathname of ip-down script", ++ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, + + #ifdef HAVE_MULTILINK + { "multilink", o_bool, &multilink, + +--- ppp-2.4.1/pppd/pathnames.h Thu Mar 8 06:15:37 2001 ++++ ppp-2.4.1-new/pppd/pathnames.h Tue Jun 19 15:35:36 2001 +@@ -21,8 +21,6 @@ + #define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets" + #define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets" + #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options" +-#define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up" +-#define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down" + #define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" + #define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" + #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." + +--- ppp-2.4.1/pppd/pppd.h Tue Mar 13 06:54:37 2001 ++++ ppp-2.4.1-new/pppd/pppd.h Tue Jun 19 15:39:39 2001 +@@ -272,6 +272,8 @@ + extern char *bundle_name; /* bundle name for multilink */ + extern bool dump_options; /* print out option values */ + extern bool dryrun; /* check everything, print options, exit */ ++extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ ++extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ + + #ifdef PPP_FILTER + extern struct bpf_program pass_filter; /* Filter for pkts to pass */ --- ppp-2.4.1.uus.orig/debian/patches/031-cbcp-cbcp.c.diff +++ ppp-2.4.1.uus/debian/patches/031-cbcp-cbcp.c.diff @@ -0,0 +1,770 @@ +diff -Naur ppp-2.4.1/pppd/cbcp.c ppp-2.4.1-CBCP/pppd/cbcp.c +--- ppp-2.4.1/pppd/cbcp.c Thu Mar 8 06:11:10 2001 ++++ ppp-2.4.1-CBCP/pppd/cbcp.c Fri Sep 8 12:11:25 2000 +@@ -18,30 +18,23 @@ + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +-#define RCSID "$Id: cbcp.c,v 1.11 2001/03/08 05:11:10 paulus Exp $" ++#ifndef lint ++static const char rcsid[] = "$Id: cbcp.c,v 1.2 1997/04/30 05:50:26 paulus Exp $"; ++#endif + + #include + #include + #include + #include ++#include ++#include + + #include "pppd.h" + #include "cbcp.h" + #include "fsm.h" + #include "lcp.h" +- +-static const char rcsid[] = RCSID; +- +-/* +- * Options. +- */ +-static int setcbcp __P((char **)); +- +-static option_t cbcp_option_list[] = { +- { "callback", o_special, setcbcp, +- "Ask for callback", OPT_PRIO | OPT_A2STRVAL, &cbcp[0].us_number }, +- { NULL } +-}; ++#include "ipcp.h" ++#include "pathnames.h" + + /* + * Protocol entry points. +@@ -69,8 +62,6 @@ + 0, + "CBCP", + NULL, +- cbcp_option_list, +- NULL, + NULL, + NULL + }; +@@ -79,26 +70,22 @@ + + /* internal prototypes */ + ++static void cbcp_sendreq __P((void *arg)); + static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len)); +-static void cbcp_resp __P((cbcp_state *us)); +-static void cbcp_up __P((cbcp_state *us)); ++static void cbcp_sendresp __P((cbcp_state *us)); ++static void cbcp_recvresp __P((cbcp_state *us, char *pckt, int len)); ++static void cbcp_sendack __P((void *)); + static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len)); ++ + static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len)); ++static void cbcp_make_options __P((int unit)); ++static int cbcp_check_user __P((char *user, char *mask)); ++static void cbcp_start_callback __P((cbcp_state *us)); ++static void cbcp_up __P((cbcp_state *us)); ++ ++ ++cbcp_state *stop_iface = NULL; + +-/* option processing */ +-static int +-setcbcp(argv) +- char **argv; +-{ +- lcp_wantoptions[0].neg_cbcp = 1; +- cbcp_protent.enabled_flag = 1; +- cbcp[0].us_number = strdup(*argv); +- if (cbcp[0].us_number == 0) +- novm("callback number"); +- cbcp[0].us_type |= (1 << CB_CONF_USER); +- cbcp[0].us_type |= (1 << CB_CONF_ADMIN); +- return (1); +-} + + /* init state */ + static void +@@ -110,7 +97,6 @@ + us = &cbcp[iface]; + memset(us, 0, sizeof(cbcp_state)); + us->us_unit = iface; +- us->us_type |= (1 << CB_CONF_NO); + } + + /* lower layer is up */ +@@ -120,18 +106,19 @@ + { + cbcp_state *us = &cbcp[iface]; + +- dbglog("cbcp_lowerup"); +- dbglog("want: %d", us->us_type); +- +- if (us->us_type == CB_CONF_USER) +- dbglog("phone no: %s", us->us_number); ++ CBCPDEBUG((LOG_DEBUG, "cbcp_lowerup")); ++ CBCPDEBUG((LOG_DEBUG, "want: %d", us->us_type)); + } + ++/* CBCP indulhat: kliens oldal eseten nincs feladat, ++ szerver oldalon atkuldeni a valszthato opciokat */ + static void + cbcp_open(unit) + int unit; + { +- dbglog("cbcp_open"); ++ CBCPDEBUG((LOG_DEBUG, "cbcp_open")); ++ if (lcp_hisoptions[unit].neg_cbcp) ++ cbcp_make_options(unit); + } + + /* process an incomming packet */ +@@ -146,11 +133,13 @@ + u_short len; + + cbcp_state *us = &cbcp[unit]; ++ lcp_options *go = &lcp_gotoptions[unit]; ++ lcp_options *his = &lcp_hisoptions[unit]; + + inp = inpacket; + + if (pktlen < CBCP_MINLEN) { +- error("CBCP packet is too small"); ++ syslog(LOG_ERR, "CBCP packet is too small"); + return; + } + +@@ -160,7 +149,7 @@ + + #if 0 + if (len > pktlen) { +- error("CBCP packet: invalid length"); ++ syslog(LOG_ERR, "CBCP packet: invalid length"); + return; + } + #endif +@@ -169,17 +158,36 @@ + + switch(code) { + case CBCP_REQ: ++ if ( !go->neg_cbcp ) ++ { ++ syslog(LOG_ERR, "CBCP received CBCP_REQ, but CBCP running in server mode!"); ++ return; ++ } + us->us_id = id; + cbcp_recvreq(us, inp, len); + break; + + case CBCP_RESP: +- dbglog("CBCP_RESP received"); ++ if ( !his->neg_cbcp ) ++ { ++ syslog(LOG_ERR, "CBCP received CBCP_RESP, but CBCP running in client mode!"); ++ return; ++ } ++ if (id != us->us_id) ++ syslog(LOG_DEBUG, "id doesn't match: expected %d recv %d", ++ us->us_id, id); ++ ++ cbcp_recvresp(us, inp, len); + break; + + case CBCP_ACK: ++ if ( !go->neg_cbcp ) ++ { ++ syslog(LOG_ERR, "CBCP received CBCP_ACK, but CBCP running in server mode!"); ++ return; ++ } + if (id != us->us_id) +- dbglog("id doesn't match: expected %d recv %d", ++ syslog(LOG_DEBUG, "id doesn't match: expected %d recv %d", + us->us_id, id); + + cbcp_recvack(us, inp, len); +@@ -259,13 +267,14 @@ + printer(arg, " delay = %d", delay); + } + +- if (olen > 3) { ++ if (olen > 4) { + int addrt; + char str[256]; + + GETCHAR(addrt, p); + memcpy(str, p, olen - 4); + str[olen - 4] = 0; ++ p += olen - 4; + printer(arg, " number = %s", str); + } + printer(arg, ">"); +@@ -291,41 +300,40 @@ + char *pckt; + int pcktlen; + { +- u_char type, opt_len, delay, addr_type; ++ u_char type, opt_len, addr_type; + char address[256]; + int len = pcktlen; + + address[0] = 0; + + while (len) { +- dbglog("length: %d", len); +- + GETCHAR(type, pckt); + GETCHAR(opt_len, pckt); + ++ us->us_delay =0; + if (opt_len > 2) +- GETCHAR(delay, pckt); ++ GETCHAR(us->us_delay, pckt); + + us->us_allowed |= (1 << type); + + switch(type) { + case CB_CONF_NO: +- dbglog("no callback allowed"); ++ CBCPDEBUG((LOG_DEBUG, "no callback allowed")); + break; + + case CB_CONF_USER: +- dbglog("user callback allowed"); ++ CBCPDEBUG((LOG_DEBUG, "user callback allowed")); + if (opt_len > 4) { + GETCHAR(addr_type, pckt); + memcpy(address, pckt, opt_len - 4); + address[opt_len - 4] = 0; + if (address[0]) +- dbglog("address: %s", address); ++ CBCPDEBUG((LOG_DEBUG, "address: %s", address)); + } + break; + + case CB_CONF_ADMIN: +- dbglog("user admin defined allowed"); ++ CBCPDEBUG((LOG_DEBUG, "user admin defined allowed")); + break; + + case CB_CONF_LIST: +@@ -334,60 +342,64 @@ + len -= opt_len; + } + +- cbcp_resp(us); ++ cbcp_sendresp(us); + } + + static void +-cbcp_resp(us) ++cbcp_sendresp(us) + cbcp_state *us; + { +- u_char cb_type; ++ u_char cb_allowed; + u_char buf[256]; + u_char *bufp = buf; + int len = 0; + +- cb_type = us->us_allowed & us->us_type; +- dbglog("cbcp_resp cb_type=%d", cb_type); ++ cb_allowed = us->us_allowed; ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp: available options: %d", cb_allowed)); + + #if 0 +- if (!cb_type) ++ if (!cb_allowed) + lcp_down(us->us_unit); + #endif + +- if (cb_type & ( 1 << CB_CONF_USER ) ) { +- dbglog("cbcp_resp CONF_USER"); ++ if (cb_allowed & ( 1 << CB_CONF_USER ) ) { /* The best metod :-) */ ++ us->us_type= ( 1 << CB_CONF_USER ); ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp CONF_USER")); + PUTCHAR(CB_CONF_USER, bufp); + len = 3 + 1 + strlen(us->us_number) + 1; + PUTCHAR(len , bufp); +- PUTCHAR(5, bufp); /* delay */ ++ PUTCHAR(us->us_delay, bufp); + PUTCHAR(1, bufp); + BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); + cbcp_send(us, CBCP_RESP, buf, len); + return; + } + +- if (cb_type & ( 1 << CB_CONF_ADMIN ) ) { +- dbglog("cbcp_resp CONF_ADMIN"); ++ if (cb_allowed & ( 1 << CB_CONF_ADMIN ) ) { ++ us->us_type= ( 1 << CB_CONF_ADMIN ); ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp CONF_ADMIN")); + PUTCHAR(CB_CONF_ADMIN, bufp); + len = 3; +- PUTCHAR(len, bufp); +- PUTCHAR(5, bufp); /* delay */ ++ PUTCHAR(len , bufp); ++ PUTCHAR(us->us_delay, bufp); + cbcp_send(us, CBCP_RESP, buf, len); + return; + } + +- if (cb_type & ( 1 << CB_CONF_NO ) ) { +- dbglog("cbcp_resp CONF_NO"); ++ if (cb_allowed & ( 1 << CB_CONF_NO ) ) { ++ us->us_type= ( 1 << CB_CONF_NO ); ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendresp CONF_NO")); + PUTCHAR(CB_CONF_NO, bufp); + len = 3; + PUTCHAR(len , bufp); + PUTCHAR(0, bufp); + cbcp_send(us, CBCP_RESP, buf, len); +- start_networks(); + return; + } ++ syslog(LOG_WARNING, "cbcp_sendresp: no usable options available!"); + } + ++/* Send the packet */ + static void + cbcp_send(us, code, buf, len) + cbcp_state *us; +@@ -414,43 +426,427 @@ + output(us->us_unit, outpacket_buf, outlen + PPP_HDRLEN); + } + ++/* Received Ack */ + static void + cbcp_recvack(us, pckt, len) + cbcp_state *us; + char *pckt; + int len; + { +- u_char type, delay, addr_type; ++ u_char type, addr_type; + int opt_len; + char address[256]; + ++ stop_iface = us; ++ + if (len) { + GETCHAR(type, pckt); + GETCHAR(opt_len, pckt); + + if (opt_len > 2) +- GETCHAR(delay, pckt); ++ GETCHAR(us->us_delay, pckt); + + if (opt_len > 4) { + GETCHAR(addr_type, pckt); + memcpy(address, pckt, opt_len - 4); + address[opt_len - 4] = 0; + if (address[0]) +- dbglog("peer will call: %s", address); ++ CBCPDEBUG((LOG_DEBUG, "peer will call: %s", address)); + } +- if (type == CB_CONF_NO) +- return; ++ if (type != CB_CONF_NO) ++ { ++ callback_in_progress = us->us_unit + 1; ++ callback_in_progress |= CBCP_CLIENT; ++ cbcp_up(us); ++ } ++ else ++ network_phase(us->us_unit); + } ++ else ++ syslog(LOG_DEBUG, "cbcp: received bad ack - packet too small"); ++ + +- cbcp_up(us); + } + +-/* ok peer will do callback */ ++/* Make options ++ if auth req, options from callback-users file, else use CBCP_CONF_USER */ ++static void ++cbcp_make_options (unit) ++ int unit; ++{ ++ cbcp_state *us = &cbcp[unit]; ++ FILE *userfile; ++ struct stat sbuf; ++ int best_fit, got_fit, newline; ++ char uname[ 256 ], option[ 256 ]; ++ ++ us->us_id = 1; ++ us->us_count = 0; ++ us->us_delay = 5; /* Default delay 5 seconds */ ++ if ( *peer_authname ) { /* Username available */ ++ userfile = fopen( _PATH_CBCP_USERS, "r" ); ++ if ( userfile == NULL ){ ++ syslog( LOG_ERR, "Can't open callback user file: %s %m", ++ _PATH_CBCP_USERS ); ++ syslog( LOG_WARNING, "Allow user definied callback." ); ++ us->us_allowed = ( 1 << CB_CONF_USER ); ++ }else ++ { ++ if ( fstat(fileno(userfile), &sbuf) < 0) { ++ syslog(LOG_WARNING, "Cannot stat userfile file %s: %m", ++ _PATH_CBCP_USERS ); ++ } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { ++ syslog(LOG_WARNING, "Warning - user file %s has world and/or group access", ++ _PATH_CBCP_USERS ); ++ } ++ ++ us->us_allowed = ( 1 << CB_CONF_NO ); /* Assume, no callback allowed */ ++ ++ if (getword(userfile, uname, &newline, _PATH_CBCP_USERS)){ /* file not empty */ ++ newline = 1; ++ best_fit = 0; ++ *option = '-'; ++ for (;;) { ++ /* ++ * Skip until we find a word at the start of a line. ++ */ ++ while (!newline && getword(userfile, uname, ++ &newline, _PATH_CBCP_USERS)) ++ ; ++ if (!newline) ++ break; /* got to end of file */ ++ ++ /* ++ * Got a user - check if it's a match or a wildcard. ++ */ ++ got_fit = cbcp_check_user( peer_authname, uname ); ++ if ( got_fit <= best_fit ){ ++ newline = 0; ++ continue; ++ } ++ ++ /* Read the options */ ++ best_fit = got_fit; ++ if (!getword(userfile, option, &newline, _PATH_CBCP_USERS)) ++ break; ++ ++ if ( newline ) ++ *option = 0; ++ ++ if ( best_fit == 100 ) ++ break; ++ } ++ } ++ ++ switch ( *option ){ ++ case '-' : us->us_allowed = ( 1 << CB_CONF_NO ); break; ++ case '*' : ++ case 0 : us->us_allowed = ( 1 << CB_CONF_USER ); break; ++ default : us->us_allowed = ( 1 << CB_CONF_ADMIN ); ++ us->us_number = strdup( option ); break; ++ } ++ fclose( userfile ); ++ } ++ } ++ else ++ us->us_allowed = ( 1 << CB_CONF_USER ); ++ ++ cbcp_sendreq( us ); ++} ++ ++ ++/* make cbcp request packet & send it */ ++static void ++cbcp_sendreq (arg) ++ void *arg; ++{ ++ cbcp_state *us=(cbcp_state *)arg; ++ u_char cb_allow = us->us_allowed; ++ u_char buf[256]; ++ u_char *bufp = buf; ++ int len = 0; ++ ++ us->us_count++; ++ if (us->us_count<=CBCP_MAXRETRY) ++ TIMEOUT( cbcp_sendreq, arg, CBCP_DEFTIMEOUT ); ++ else ++ { ++ lcp_close(0, "Sorry, CBCP not responding."); ++ return; ++ } ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq cb_allowed=%d", cb_allow)); ++ ++ ++ if (cb_allow & ( 1 << CB_CONF_USER ) ) { ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq CONF_USER")); ++ PUTCHAR(CB_CONF_USER, bufp); ++ len+=3; ++ PUTCHAR(3 , bufp); ++ PUTCHAR(us->us_delay, bufp); ++ } ++ ++ if (cb_allow & ( 1 << CB_CONF_ADMIN ) ) { ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq CONF_ADMIN")); ++ PUTCHAR(CB_CONF_ADMIN, bufp); ++ len += 3; ++ PUTCHAR(3 , bufp); ++ PUTCHAR(us->us_delay, bufp); ++ } ++ ++ if (cb_allow & ( 1 << CB_CONF_NO ) ) { ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendreq CONF_NO")); ++ PUTCHAR(CB_CONF_NO, bufp); ++ len += 3; ++ PUTCHAR(3 , bufp); ++ PUTCHAR(us->us_delay, bufp); ++ } ++ ++ if (len) ++ cbcp_send(us, CBCP_REQ, buf, len); ++ else ++ { ++ syslog(LOG_WARNING, "cbcp: no available options to client!"); ++ } ++} ++ ++/* Received CBCP response, make ACK */ ++static void ++cbcp_recvresp (us, pckt, len) ++ cbcp_state *us; ++ char *pckt; ++ int len; ++{ ++ u_char type, addr_type; ++ int opt_len; ++ char address[256]; ++ ++ if (len) { ++ GETCHAR(type, pckt); ++ GETCHAR(opt_len, pckt); ++ ++ if (!(( 1 << type )& us->us_allowed )) { ++ CBCPDEBUG((LOG_DEBUG, "CBCP received options not allowed on server!")); ++ return; ++ } ++ ++ if ((type!= CB_CONF_NO ) && ++ (type!= CB_CONF_USER ) && ++ (type!= CB_CONF_ADMIN )) { ++ syslog(LOG_DEBUG, "CBCP received BAD Response: too more or unknown options %d",type); ++ return; ++ } ++ ++ UNTIMEOUT( cbcp_sendreq, us ); ++ us->us_count = 0; ++ ++ ++ if (opt_len > 2) ++ GETCHAR(us->us_delay, pckt) ++ if ( us->us_delay < 5 ) ++ us->us_delay = 5; ++ ++ if (opt_len > 4) { ++ GETCHAR(addr_type, pckt); /* Address Type mezo elvesztve !!! */ ++ memcpy(address, pckt, opt_len - 4); ++ address[opt_len - 4] = 0; ++ if (address[0]) ++ syslog(LOG_DEBUG, "peer will callback the client on: %s", address); ++ us->us_number=strdup( address ); ++ } ++ ++ us->us_type = ( 1 << type ); ++ cbcp_sendack( us ); ++ } ++ else ++ { ++ syslog(LOG_DEBUG, "CBCP received BAD Response: size to small"); ++ } ++} ++ ++/* Send the CBCP_ACK packet */ ++static void ++cbcp_sendack (arg) ++ void *arg; ++{ ++ cbcp_state *us= (cbcp_state *)arg; ++ u_char cb_type; ++ u_char buf[256]; ++ u_char *bufp = buf; ++ int len = 0; ++ ++ stop_iface = (cbcp_state *)arg; ++ cb_type = us->us_type; ++ ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendack cb_type=%d", cb_type)); ++ ++ us->us_count++; ++ if (us->us_count<=CBCP_MAXRETRY) ++ TIMEOUT( cbcp_sendack, arg, CBCP_DEFTIMEOUT ); ++ else ++ { ++ lcp_close(0, "Sorry, CBCP not responding."); ++ return; ++ } ++ ++#if 0 ++ if (!cb_type) ++ lcp_down(us->us_unit); ++#endif ++ ++ if (cb_type == (1 << CB_CONF_USER )) { ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendack CONF_USER")); ++ PUTCHAR(CB_CONF_USER, bufp); ++ len = 3 + 1 + strlen(us->us_number) + 1; ++ PUTCHAR(len , bufp); ++ PUTCHAR(us->us_delay, bufp); /* delay */ ++ PUTCHAR(1, bufp); /* Elvesztett byte... */ ++ BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); ++ cbcp_send(us, CBCP_ACK, buf, len); ++/* lcp_close( 2, "Illegal, but required to server..." ); */ ++ callback_in_progress = us->us_unit + 1; ++ return; ++ } ++ ++ if (cb_type == (1 << CB_CONF_ADMIN )) { ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendack CONF_ADMIN")); ++ PUTCHAR(CB_CONF_ADMIN, bufp); ++ len = 3 + 1; ++ PUTCHAR(len , bufp); ++ PUTCHAR(us->us_delay, bufp); /* delay */ ++ PUTCHAR(0, bufp); ++ cbcp_send(us, CBCP_ACK, buf, len); ++/* lcp_close( 2, "Illegal, but required to server..." ); */ ++ callback_in_progress = us->us_unit + 1; ++ return; ++ } ++ ++ if (cb_type == (1 << CB_CONF_NO )) { ++ CBCPDEBUG((LOG_DEBUG, "cbcp_sendack CONF_NO")); ++ PUTCHAR(CB_CONF_NO, bufp); ++ len = 3; ++ PUTCHAR(len , bufp); ++ PUTCHAR(0, bufp); ++ cbcp_send(us, CBCP_ACK, buf, len); ++ if (us->us_count<=1) ++ network_phase(us->us_unit); ++ return; ++ } ++ ++ syslog(LOG_DEBUG, "CBCP - Bad options in Ack routine."); ++ ++} ++ ++/* CBCP coming succesful up */ ++void cbcp_stop() ++{ ++ if ( stop_iface && lcp_allowoptions[stop_iface->us_unit].neg_cbcp ) ++ { ++ UNTIMEOUT( cbcp_sendack, stop_iface ); ++ cbcp_start_callback( stop_iface ); ++ } ++} ++ ++/* The server side coming up & client 'ack-ed' */ ++void cbcp_start_callback (us) ++ cbcp_state *us; ++{ ++ lcp_allowoptions[us->us_unit].neg_cbcp=0; ++ ++ CBCPDEBUG((LOG_DEBUG, "cbcp_start_callback running")); ++} ++ ++/* The client side coming up: server allowed the callback */ + static void + cbcp_up(us) + cbcp_state *us; + { +- persist = 0; +- lcp_close(0, "Call me back, please"); +- status = EXIT_CALLBACK; ++ lcp_wantoptions[us->us_unit].neg_cbcp=0; ++ CBCPDEBUG((LOG_DEBUG, "cbcp_up called")); ++ lcp_close(us->us_unit, "Call me back, please"); + } ++ ++/* The main module gets the script with parameters to run */ ++char *cbcp_get_script() ++{ ++ cbcp_state *us = &cbcp[(callback_in_progress & CBCP_NCLIENT)-1]; ++ char script[ 256 ]; ++ ++ if ( callback_in_progress & CBCP_CLIENT ) ++ sprintf( script, "%s %d", _PATH_CBCP_CLIENT, us->us_delay ); ++ else ++ sprintf( script, "%s %d %s", _PATH_CBCP_SERVER, ++ us->us_delay, us->us_number ); ++ ++ return strdup( script ); ++} ++ ++/* give me the hit rate. wild cars '*?' valids */ ++int cbcp_check_user ( user, mask ) ++ char *user; ++ char *mask; ++{ ++ char *curr_user = user; ++ char *curr_mask = mask; ++ char *find, backp = 0; ++ int count, len = 0; ++ ++ if ( !strcmp( user, mask )) ++ return 100; ++ ++ if ( !strcmp( mask, "*" )) ++ return 1; ++ ++ if ( !*user ) ++ return 0; ++ ++ count = 0; ++ ++ while(( find = strpbrk( curr_mask, "*?" )) != 0 ) { ++ if ( find != curr_mask ){ ++ len = find - curr_mask; ++ if ( strncmp( curr_user, curr_mask, len )) ++ break; ++ } ++ ++ curr_mask += len + 1; ++ curr_user += len; ++ count += len; ++ if ( *curr_user == 0 ) ++ break; ++ ++ if ( *find == '?' ) { ++ curr_user++; ++ if ( *curr_user == 0 ) ++ break; ++ } else { ++ if ( *curr_mask == 0 ) ++ break; ++ ++ if ( ( find = strpbrk( curr_mask, "*?" )) != 0 ){ ++ backp = *find; ++ *find = 0; ++ } ++ curr_user = strstr( curr_user, curr_mask ); ++ if ( find ) ++ *find = backp; ++ if ( !curr_user ) ++ break; ++ ++ find = strpbrk( curr_mask, "*?" ); ++ if ( find ) ++ len = find - curr_mask; ++ else ++ len = strlen( curr_mask ); ++ ++ curr_mask += len; ++ curr_user += len; ++ count += len; ++ } ++ } ++ ++ if ( *curr_user && *curr_mask && !strcmp( curr_user, curr_mask )) ++ count += strlen( curr_user ); ++ ++ return ( count * 100 / strlen( user ) ); ++} ++ --- ppp-2.4.1.uus.orig/debian/patches/009_SETUP.diff +++ ppp-2.4.1.uus/debian/patches/009_SETUP.diff @@ -0,0 +1,11 @@ +--- ppp-2.4.0b4.orig/SETUP ++++ ppp-2.4.0b4/SETUP +@@ -21,7 +21,7 @@ + that you will be dialling. For example, suppose the file is called + /etc/ppp/peers/isp. This file would contain something like this: + +-cua0 # modem is connected to /dev/cua0 ++ttyS0 # modem is connected to /dev/ttyS0 + 38400 # run the serial port at 38400 baud + crtscts # use hardware flow control + noauth # don't require the ISP to authenticate itself --- ppp-2.4.1.uus.orig/debian/patches/032-cbcp-cbcp.h.diff +++ ppp-2.4.1.uus/debian/patches/032-cbcp-cbcp.h.diff @@ -0,0 +1,32 @@ +diff -Naur ppp-2.4.1/pppd/cbcp.h ppp-2.4.1-CBCP/pppd/cbcp.h +--- ppp-2.4.1/pppd/cbcp.h Sat Nov 7 07:55:38 1998 ++++ ppp-2.4.1-CBCP/pppd/cbcp.h Fri Sep 8 12:11:25 2000 +@@ -6,6 +6,8 @@ + u_char us_id; /* Current id */ + u_char us_allowed; + int us_type; ++ u_char us_delay; ++ u_char us_count; + char *us_number; /* Telefone Number */ + } cbcp_state; + +@@ -19,8 +21,19 @@ + #define CBCP_RESP 2 + #define CBCP_ACK 3 + ++#define CBCP_DEFTIMEOUT 5 ++#define CBCP_MAXRETRY 50 ++#define CBCP_CLIENT 0x8000 ++#define CBCP_NCLIENT 0x7fff ++ ++#define CBCPDEBUG(x) if (debug) syslog x ++ + #define CB_CONF_NO 1 + #define CB_CONF_USER 2 + #define CB_CONF_ADMIN 3 + #define CB_CONF_LIST 4 ++ ++char *cbcp_get_script __P(()); ++void cbcp_stop __P(()); ++ + #endif --- ppp-2.4.1.uus.orig/debian/patches/021_setipaddr.diff +++ ppp-2.4.1.uus/debian/patches/021_setipaddr.diff @@ -0,0 +1,33 @@ +--- ppp-2.4.1/pppd/ipcp.c Thu Mar 8 06:11:12 2001 ++++ ppp-2.4.1-new/pppd/ipcp.c Tue Jun 19 15:49:59 2001 +@@ -109,7 +109,8 @@ + static int setdnsaddr __P((char **)); + static int setwinsaddr __P((char **)); + static int setnetmask __P((char **)); +-static int setipaddr __P((char *, char **, int)); ++/* setipaddr() must not be static, otherwise you can't connect with portslave */ ++int setipaddr __P((char *, char **, int)); + static void printipaddr __P((option_t *, void (*)(void *, char *,...),void *)); + + static option_t ipcp_option_list[] = { +@@ -375,7 +376,7 @@ + * If doit is 0, the call is to check whether this option is + * potentially an IP address specification. + */ +-static int ++int + setipaddr(arg, argv, doit) + char *arg; + char **argv; + +--- ppp-2.4.1/pppd/pppd.h Tue Mar 13 06:54:37 2001 ++++ ppp-2.4.1-new/pppd/pppd.h Tue Jun 19 15:47:34 2001 +@@ -572,6 +572,7 @@ + char *get_first_ethernet __P((void)); + + /* Procedures exported from options.c */ ++int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */ + int parse_args __P((int argc, char **argv)); + /* Parse options from arguments given */ + int options_from_file __P((char *filename, int must_exist, int check_prot, + --- ppp-2.4.1.uus.orig/debian/patches/033-cbcp-ipcp.c.diff +++ ppp-2.4.1.uus/debian/patches/033-cbcp-ipcp.c.diff @@ -0,0 +1,24 @@ +diff -Naur ppp-2.4.1/pppd/ipcp.c ppp-2.4.1-CBCP/pppd/ipcp.c +--- ppp-2.4.1/pppd/ipcp.c Thu Mar 8 06:11:12 2001 ++++ ppp-2.4.1-CBCP/pppd/ipcp.c Thu Jun 21 16:42:57 2001 +@@ -37,6 +37,9 @@ + #include "fsm.h" + #include "ipcp.h" + #include "pathnames.h" ++#ifdef CBCP_SUPPORT ++#include "cbcp.h" ++#endif + + static const char rcsid[] = RCSID; + +@@ -1223,6 +1226,10 @@ + int l = *len; /* Length left */ + u_char maxslotindex, cflag; + int d; ++ ++#ifdef CBCP_SUPPORT ++ cbcp_stop(); ++#endif + + /* + * Reset all his options. --- ppp-2.4.1.uus.orig/debian/patches/005_fsm.c.diff +++ ppp-2.4.1.uus/debian/patches/005_fsm.c.diff @@ -0,0 +1,31 @@ +--- ppp-2.4.0b4.orig/pppd/fsm.c ++++ ppp-2.4.0b4/pppd/fsm.c +@@ -213,13 +213,21 @@ + (*f->callbacks->down)(f); /* Inform upper layers we're down */ + + /* Init restart counter, send Terminate-Request */ +- f->retransmits = f->maxtermtransmits; +- fsm_sdata(f, TERMREQ, f->reqid = ++f->id, +- (u_char *) f->term_reason, f->term_reason_len); +- TIMEOUT(fsm_timeout, f, f->timeouttime); +- --f->retransmits; +- +- f->state = CLOSING; ++ if (f->retransmits > 0) { ++ fsm_sdata(f, TERMREQ, f->reqid = ++f->id, ++ (u_char *) f->term_reason, f->term_reason_len); ++ TIMEOUT(fsm_timeout, f, f->timeouttime); ++ --f->retransmits; ++ ++ f->state = CLOSING; ++ } else { ++ /* ++ * Term requests disabled at the user's discretion. ++ */ ++ f->state = CLOSED; ++ if( f->callbacks->finished ) ++ (*f->callbacks->finished)(f); ++ } + break; + } + } --- ppp-2.4.1.uus.orig/debian/patches/034-cbcp-ipv6cp.c.diff +++ ppp-2.4.1.uus/debian/patches/034-cbcp-ipv6cp.c.diff @@ -0,0 +1,24 @@ +diff -Naur ppp-2.4.1/pppd/ipv6cp.c ppp-2.4.1-CBCP/pppd/ipv6cp.c +--- ppp-2.4.1/pppd/ipv6cp.c Fri Mar 23 12:23:54 2001 ++++ ppp-2.4.1-CBCP/pppd/ipv6cp.c Thu Jun 21 16:42:45 2001 +@@ -121,6 +121,9 @@ + #include "ipv6cp.h" + #include "magic.h" + #include "pathnames.h" ++#ifdef CBCP_SUPPORT ++#include "cbcp.h" ++#endif + + static const char rcsid[] = RCSID; + +@@ -852,6 +855,10 @@ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ ++ ++#ifdef CBCP_SUPPORT ++ cbcp_stop(); ++#endif + + /* + * Reset all his options. --- ppp-2.4.1.uus.orig/debian/patches/023_lcp-max-termintate.diff +++ ppp-2.4.1.uus/debian/patches/023_lcp-max-termintate.diff @@ -0,0 +1,10 @@ +--- ppp-2.4.1.orig/pppd/fsm.c Wed Jul 4 23:34:27 2001 ++++ ppp-2.4.1/pppd/fsm.c Wed Jul 4 23:34:12 2001 +@@ -213,6 +213,7 @@ + (*f->callbacks->down)(f); /* Inform upper layers we're down */ + + /* Init restart counter, send Terminate-Request */ ++ f->retransmits = f->maxtermtransmits; + if (f->retransmits > 0) { + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (u_char *) f->term_reason, f->term_reason_len); --- ppp-2.4.1.uus.orig/debian/patches/035-cbcp-ipxcp.c.diff +++ ppp-2.4.1.uus/debian/patches/035-cbcp-ipxcp.c.diff @@ -0,0 +1,24 @@ +diff -Naur ppp-2.4.1/pppd/ipxcp.c ppp-2.4.1-CBCP/pppd/ipxcp.c +--- ppp-2.4.1/pppd/ipxcp.c Thu Mar 8 06:11:13 2001 ++++ ppp-2.4.1-CBCP/pppd/ipxcp.c Thu Jun 21 16:44:08 2001 +@@ -38,6 +38,9 @@ + #include "ipxcp.h" + #include "pathnames.h" + #include "magic.h" ++#ifdef CBCP_SUPPORT ++#include "cbcp.h" ++#endif + + static const char rcsid[] = RCSID; + +@@ -974,6 +977,10 @@ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ ++ ++#ifdef CBCP_SUPPORT ++ cbcp_stop(); ++#endif + + /* + * Reset all his options. --- ppp-2.4.1.uus.orig/debian/patches/004_auth.c.diff +++ ppp-2.4.1.uus/debian/patches/004_auth.c.diff @@ -0,0 +1,11 @@ +--- ppp-2.4.0b4.orig/pppd/auth.c ++++ ppp-2.4.0b4/pppd/auth.c +@@ -1120,7 +1120,7 @@ + if (pam_error == PAM_SUCCESS && !PAM_error) { + pam_error = pam_acct_mgmt (pamh, PAM_SILENT); + if (pam_error == PAM_SUCCESS) +- pam_open_session (pamh, PAM_SILENT); ++ pam_error = pam_open_session (pamh, PAM_SILENT); + } + + *msg = (char *) pam_strerror (pamh, pam_error); --- ppp-2.4.1.uus.orig/debian/patches/036-cbcp-lcp.c.diff +++ ppp-2.4.1.uus/debian/patches/036-cbcp-lcp.c.diff @@ -0,0 +1,31 @@ +diff -Naur ppp-2.4.1/pppd/lcp.c ppp-2.4.1-CBCP/pppd/lcp.c +--- ppp-2.4.1/pppd/lcp.c Thu Mar 8 06:11:14 2001 ++++ ppp-2.4.1-CBCP/pppd/lcp.c Thu Jun 21 16:50:08 2001 +@@ -342,9 +342,6 @@ + ao->neg_magicnumber = 1; + ao->neg_pcompression = 1; + ao->neg_accompression = 1; +-#ifdef CBCP_SUPPORT +- ao->neg_cbcp = 1; +-#endif + ao->neg_endpoint = 1; + } + +@@ -1703,6 +1700,16 @@ + INCPTR(cilen, p); + break; + ++ case CI_CALLBACK: ++ LCPDEBUG((LOG_INFO, "lcp_reqci: rcvd CALLBACK")); ++ if (!ao->neg_cbcp || ++ cilen != CILEN_CHAR) { ++ orc = CONFREJ; ++ break; ++ } ++ ho->neg_cbcp = 1; ++ break; ++ + default: + LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); + orc = CONFREJ; + --- ppp-2.4.1.uus.orig/debian/patches/025_packet_count.diff +++ ppp-2.4.1.uus/debian/patches/025_packet_count.diff @@ -0,0 +1,23 @@ +# um.... +# foo +--- ppp-2.4.1.orig/pppd/pppd.h Tue Mar 13 06:54:37 2001 ++++ ppp-2.4.1/pppd/pppd.h Mon Jul 9 17:44:28 2001 +@@ -147,6 +147,8 @@ + struct pppd_stats { + unsigned int bytes_in; + unsigned int bytes_out; ++ unsigned int packets_in; ++ unsigned int packets_out; + }; + + /* Used for storing a sequence of words. Usually malloced. */ +--- ppp-2.4.1.org/pppd/sys-linux.c Tue Mar 13 06:54:41 2001 ++++ ppp-2.4.1/pppd/sys-linux.c Mon Jul 9 17:44:28 2001 +@@ -1236,6 +1236,8 @@ + } + stats->bytes_in = req.stats.p.ppp_ibytes; + stats->bytes_out = req.stats.p.ppp_obytes; ++ stats->packets_in = req.stats.p.ppp_ipackets; ++ stats->packets_out = req.stats.p.ppp_opackets; + return 1; + } --- ppp-2.4.1.uus.orig/debian/patches/038-cbcp-options.c.diff +++ ppp-2.4.1.uus/debian/patches/038-cbcp-options.c.diff @@ -0,0 +1,65 @@ +diff -Naur ppp-2.4.1/pppd/options.c ppp-2.4.1-CBCP/pppd/options.c +--- ppp-2.4.1/pppd/options.c Tue Mar 13 06:56:19 2001 ++++ ppp-2.4.1-CBCP/pppd/options.c Thu Jun 21 17:49:03 2001 +@@ -43,6 +43,13 @@ + char *strdup __P((char *)); + #endif + ++#ifdef CBCP_SUPPORT ++#include "fsm.h" ++#include "lcp.h" ++#include "cbcp.h" ++#endif ++ ++ + static const char rcsid[] = RCSID; + + struct option_value { +@@ -130,6 +137,11 @@ + static int n_arguments __P((option_t *)); + static int number_option __P((char *, u_int32_t *, int)); + ++#ifdef CBCP_SUPPORT ++static int setcbcp __P((char**)); ++#endif ++ ++ + /* + * Structure to store extra lists of options. + */ +@@ -270,6 +282,11 @@ + "set filter for active pkts", OPT_PRIO }, + #endif + ++#ifdef CBCP_SUPPORT ++ { "callback", o_special, setcbcp, ++ "Callback request to server - OR - calling back the client." }, ++#endif ++ + { NULL } + }; + +@@ -1519,3 +1536,23 @@ + return 0; + } + #endif /* PLUGIN */ ++ ++#ifdef CBCP_SUPPORT ++static int ++setcbcp(argv) ++ char **argv; ++{ ++ cbcp[0].us_number = strdup(*argv); ++ if (cbcp_protent.enabled_flag) ++ novm("Only one callback parameter supported!"); ++ if (cbcp[0].us_number == 0) ++ novm("callback number"); ++ if (!strcmp(cbcp[0].us_number,"server")){ ++ lcp_allowoptions[0].neg_cbcp = 1; ++ } else { ++ lcp_wantoptions[0].neg_cbcp = 1; ++ } ++ cbcp_protent.enabled_flag = 1; ++ return 1; ++} ++#endif --- ppp-2.4.1.uus.orig/debian/patches/003_cbcp.diff +++ ppp-2.4.1.uus/debian/patches/003_cbcp.diff @@ -0,0 +1,20 @@ +--- ppp-2.4.0b4.orig/pppd/Makefile.linux ++++ ppp-2.4.0b4/pppd/Makefile.linux +@@ -15,7 +15,7 @@ + MANPAGES = pppd.8 + PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \ + auth.o options.o demand.o utils.o sys-linux.o ipxcp.o multilink.o \ +- tdb.o tty.o ++ tdb.o tty.o cbcp.o + + all: pppd + +@@ -56,7 +56,7 @@ + + INCLUDE_DIRS= -I../include + +-COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP ++COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP -DCBCP_SUPPORT + + CFLAGS= $(UDEB_CFLAGS) $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) + --- ppp-2.4.1.uus.orig/debian/patches/039-cbcp-patchlevel.h.diff +++ ppp-2.4.1.uus/debian/patches/039-cbcp-patchlevel.h.diff @@ -0,0 +1,10 @@ +diff -Naur ppp-2.4.1/pppd/patchlevel.h ppp-2.4.1-CBCP/pppd/patchlevel.h +--- ppp-2.4.1/pppd/patchlevel.h Sun Mar 25 06:51:54 2001 ++++ ppp-2.4.1-CBCP/pppd/patchlevel.h Thu Jun 21 17:05:04 2001 +@@ -1,4 +1,4 @@ + /* $Id: patchlevel.h,v 1.53 2001/03/25 04:51:54 paulus Exp $ */ + +-#define VERSION "2.4.1" +-#define DATE "25 March 2001" ++#define VERSION "2.4.1 with Callback extension" ++#define DATE "21 Juni 2001" --- ppp-2.4.1.uus.orig/debian/patches/017_memory_management.diff +++ ppp-2.4.1.uus/debian/patches/017_memory_management.diff @@ -0,0 +1,12 @@ +--- ppp-2.4.1.orig/pppd/main.c Tue Mar 13 06:56:19 2001 ++++ ppp-2.4.1/pppd/main.c Tue Jul 10 07:47:28 2001 +@@ -1779,6 +1779,9 @@ + if (tdb_store(pppdb, key, dbuf, TDB_REPLACE)) + error("tdb_store failed: %s", tdb_error(pppdb)); + ++ if (vbuf) ++ free(vbuf); ++ + } + + /* --- ppp-2.4.1.uus.orig/debian/patches/040-cbcp-pppd.h.diff +++ ppp-2.4.1.uus/debian/patches/040-cbcp-pppd.h.diff @@ -0,0 +1,32 @@ +diff -Naur ppp-2.4.1/pppd/pppd.h ppp-2.4.1-CBCP/pppd/pppd.h +--- ppp-2.4.1/pppd/pppd.h Tue Mar 13 06:54:37 2001 ++++ ppp-2.4.1-CBCP/pppd/pppd.h Thu Jun 28 11:45:01 2001 +@@ -219,6 +219,9 @@ + extern struct notifier *exitnotify; /* for notification that we're exiting */ + extern struct notifier *sigreceived; /* notification of received signal */ + extern int listen_time; /* time to listen first (ms) */ ++#ifdef CBCP_SUPPORT ++extern int callback_in_progress; /* callback indicator */ ++#endif + + /* Values for do_callback and doing_callback */ + #define CALLBACK_DIALIN 1 /* we are expecting the call back */ +@@ -292,6 +295,10 @@ + extern char *option_source; /* string saying where the option came from */ + extern int option_priority; /* priority of current options */ + ++#ifdef CBCP_SUPPORT ++extern int callback_in_progress; /* Callback state indicator */ ++#endif ++ + /* + * Values for phase. + */ +@@ -447,6 +454,7 @@ + void end_pr_log __P((void)); /* finish up after using pr_log */ + + /* Procedures exported from auth.c */ ++void network_phase __P((int)); /* the dataexcahnger CP-s goung up */ + void link_required __P((int)); /* we are starting to use the link */ + void link_terminated __P((int)); /* we are finished with the link */ + void link_down __P((int)); /* the LCP layer has left the Opened state */ --- ppp-2.4.1.uus.orig/debian/patches/006_ipcp.c.diff +++ ppp-2.4.1.uus/debian/patches/006_ipcp.c.diff @@ -0,0 +1,32 @@ +--- ppp-2.4.0b4.orig/pppd/ipcp.c ++++ ppp-2.4.0b4/pppd/ipcp.c +@@ -241,6 +241,13 @@ + #define CILEN_ADDR 6 /* new-style single address option */ + #define CILEN_ADDRS 10 /* old-style dual address option */ + ++/* ++ * Added to allow static and dynamic ips(s) ++ * Hold the static address from pap-secrets ++ */ ++u_int32_t staticaddr; ++/******************************************/ ++ + + #define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") +@@ -1263,6 +1270,15 @@ + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u_int32_t), p); ++ ++ /* ++ * Added to allow static and dynamic ip(s) ++ * Are they asking for their static ip from pap-secrets? ++ */ ++ if(ciaddr1 !=0 && ciaddr1 == staticaddr) ++ wo->hisaddr = staticaddr; /* Let them use the static ip */ ++ /*******************************************/ ++ + tl = ntohl(wo->hisaddr); + PUTLONG(tl, p); + } --- ppp-2.4.1.uus.orig/debian/patches/041-cbcp-tty.c.diff +++ ppp-2.4.1.uus/debian/patches/041-cbcp-tty.c.diff @@ -0,0 +1,70 @@ +diff -Naur ppp-2.4.1/pppd/tty.c ppp-2.4.1-CBCP/pppd/tty.c +--- ppp-2.4.1/pppd/tty.c Tue Mar 13 06:54:43 2001 ++++ ppp-2.4.1-CBCP/pppd/tty.c Thu Jun 28 12:15:14 2001 +@@ -49,6 +49,11 @@ + #include "fsm.h" + #include "lcp.h" + ++#ifdef CBCP_SUPPORT ++#include "cbcp.h" ++#endif ++ ++ + void tty_process_extra_options __P((void)); + void tty_check_options __P((void)); + int connect_tty __P((void)); +@@ -499,6 +504,12 @@ + hungup = 0; + kill_link = 0; + connector = doing_callback? callback_script: connect_script; ++#ifdef CBCP_SUPPORT ++ if ( callback_in_progress ) ++ { ++ connector = cbcp_get_script(); ++ } ++#endif + if (devnam[0] != 0) { + for (;;) { + /* If the user specified the device name, become the +@@ -616,7 +627,15 @@ + + if (connector && connector[0]) { + if (device_script(connector, ttyfd, ttyfd, 0) < 0) { ++#ifdef CBCP_SUPPORT ++ if ( callback_in_progress ) { ++ error("Callback script failed" ); ++ } else { ++#endif + error("Connect script failed"); ++#ifdef CBCP_SUPPORT ++ } ++#endif + status = EXIT_CONNECT_FAILED; + return -1; + } +@@ -656,7 +675,11 @@ + script_setenv("SPEED", numbuf, 0); + + /* run welcome script, if any */ +- if (welcomer && welcomer[0]) { ++ if (welcomer && welcomer[0] ++#ifdef CBCP_SUPPORT ++ && !callback_in_progress ++#endif ++ ) { + if (device_script(welcomer, ttyfd, ttyfd, 0) < 0) + warn("Welcome script failed"); + } +@@ -675,7 +698,11 @@ + + void disconnect_tty() + { +- if (disconnect_script == NULL || hungup) ++ if (disconnect_script == NULL || hungup ++#ifdef CBCP_SUPPORT ++ || callback_in_progress ++#endif ++ ) + return; + if (real_ttyfd >= 0) + set_up_tty(real_ttyfd, 1); --- ppp-2.4.1.uus.orig/debian/patches/001_udeb.diff +++ ppp-2.4.1.uus/debian/patches/001_udeb.diff @@ -0,0 +1,22 @@ +--- ppp-2.4.0b4.orig/chat/Makefile.linux ++++ ppp-2.4.0b4/chat/Makefile.linux +@@ -6,7 +6,7 @@ + CDEF4= -DFNDELAY=O_NDELAY # Old name value + CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) + +-CFLAGS= -O2 -g -pipe $(CDEFS) ++CFLAGS= $(UDEB_CFLAGS) -O2 -g -pipe $(CDEFS) + + INSTALL= install + +--- ppp-2.4.0b4.orig/pppd/Makefile.linux ++++ ppp-2.4.0b4/pppd/Makefile.linux +@@ -58,7 +58,7 @@ + + COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP + +-CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) ++CFLAGS= $(UDEB_CFLAGS) $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) + + ifdef CHAPMS + CFLAGS += -DCHAPMS=1 --- ppp-2.4.1.uus.orig/debian/patches/037-cbcp-main.c.diff +++ ppp-2.4.1.uus/debian/patches/037-cbcp-main.c.diff @@ -0,0 +1,95 @@ +diff -Naur ppp-2.4.1/pppd/main.c ppp-2.4.1-CBCP/pppd/main.c +--- ppp-2.4.1/pppd/main.c Tue Mar 13 06:56:19 2001 ++++ ppp-2.4.1-CBCP/pppd/main.c Thu Jun 28 12:08:34 2001 +@@ -138,6 +138,11 @@ + int link_connect_time; + int link_stats_valid; + ++#ifdef CBCP_SUPPORT ++int callback_in_progress; /* Callback running indicator */ ++#endif ++ ++ + /* + * We maintain a list of child process pids and + * functions to call when they exit. +@@ -481,8 +486,13 @@ + + add_fd(fd_ppp); + lcp_open(0); /* Start protocol */ ++#ifdef CBCP_SUPPORT ++ for( callback_in_progress=1;callback_in_progress;) { /* Extra loop for callback */ ++ callback_in_progress=0; ++#endif + status = EXIT_NEGOTIATION_FAILED; + new_phase(PHASE_ESTABLISH); ++ + while (phase != PHASE_DEAD) { + handle_events(); + get_input(); +@@ -496,6 +506,57 @@ + } + } + ++#ifdef CBCP_SUPPORT ++ if (callback_in_progress){ ++ cbcp_stop(); ++ remove_fd(fd_ppp); ++ clean_check(); ++ the_channel->disestablish_ppp(devfd); ++ fd_ppp = -1; ++ if (!hungup) ++ lcp_lowerdown(0); ++ ++ the_channel->disconnect(); ++ the_channel->close(); ++ hungup=0; ++ ++ devfd = the_channel->connect(); ++ if (devfd < 0) ++ goto fail; ++ ++ cbcp_protent.enabled_flag = 0; /* Already not needed */ ++ ++ /* set up the serial device as a ppp interface */ ++ tdb_writelock(pppdb); ++ fd_ppp = the_channel->establish_ppp(devfd); ++ if (fd_ppp < 0) { ++ tdb_writeunlock(pppdb); ++ status = EXIT_FATAL_ERROR; ++ goto disconnect; ++ } ++ ++ if (!demand && ifunit >= 0) ++ set_ifunit(1); ++ tdb_writeunlock(pppdb); ++ ++ /* ++ * Start opening the connection and wait for ++ * incoming events (reply, timeout, etc.). ++ */ ++ notice("Connect: %s <--> %s", ifname, ppp_devnam); ++ gettimeofday(&start_time, NULL); ++ link_stats_valid = 0; ++ script_unsetenv("CONNECT_TIME"); ++ script_unsetenv("BYTES_SENT"); ++ script_unsetenv("BYTES_RCVD"); ++ lcp_lowerup(0); ++ ++ add_fd(fd_ppp); ++ lcp_open(0); /* Start protocol */ ++ } ++ } ++#endif ++ + /* + * Print connect time and statistics. + */ +@@ -529,6 +590,7 @@ + fd_ppp = -1; + if (!hungup) + lcp_lowerdown(0); ++ + if (!demand) + script_unsetenv("IFNAME"); + --- ppp-2.4.1.uus.orig/debian/patches/020_IPPROTO_TCP_undefine.diff +++ ppp-2.4.1.uus/debian/patches/020_IPPROTO_TCP_undefine.diff @@ -0,0 +1,11 @@ +--- ppp-2.4.1.orig/pppd/ipcp.c Wed Jul 4 21:49:07 2001 ++++ ppp-2.4.1/pppd/ipcp.c Wed Jul 4 21:48:46 2001 +@@ -2028,7 +2028,7 @@ + */ + #define IP_HDRLEN 20 /* bytes */ + #define IP_OFFMASK 0x1fff +-#define IPPROTO_TCP 6 ++/* in /usr/include/netinet/in.h #define IPPROTO_TCP 6 */ + #define TCP_HDRLEN 20 + #define TH_FIN 0x01 + --- ppp-2.4.1.uus.orig/debian/patches/012_secure-card.diff +++ ppp-2.4.1.uus/debian/patches/012_secure-card.diff @@ -0,0 +1,32 @@ +--- ppp-2.4.0b4.orig/scripts/secure-card ++++ ppp-2.4.0b4/scripts/secure-card +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/expect -f ++#!/usr/bin/expect -f + # + # This script was written by Jim Isaacson . It is + # designed to work as a script to use the SecureCARD(tm) device. This +@@ -17,14 +17,14 @@ + + send_user "hello, starting ppp\n" + +-system "stty 19200 -echoe -echo raw < /dev/cua3 > /dev/cua3" ++system "stty 19200 -echoe -echo raw < /dev/ttyS3 > /dev/ttyS3" + + # + # These are the parameters for the program. + # + set user Pxxxxxx + set password xxxxxxx +-set modem /dev/cua3 ++set modem /dev/ttyS3 + set dialup + set timeout 60 + +@@ -107,5 +107,5 @@ + } + } + +-overlay -0 $spawn_id -1 $spawn_id pppd /dev/cua3 19200 192.111.187.215: \ ++overlay -0 $spawn_id -1 $spawn_id pppd /dev/ttyS3 19200 192.111.187.215: \ + crtscts modem defaultroute debug --- ppp-2.4.1.uus.orig/debian/patches/024_pppd.8-persist-maxfail.diff +++ ppp-2.4.1.uus/debian/patches/024_pppd.8-persist-maxfail.diff @@ -0,0 +1,13 @@ +# the manpage is slightly unclear here. +--- ppp-2.4.1.orig/pppd/pppd.8 Tue Mar 13 18:54:37 2001 ++++ ppp-2.4.1/pppd/pppd.8 Thu Jul 5 00:02:09 2001 +@@ -790,7 +790,8 @@ + .TP + .B persist + Do not exit after a connection is terminated; instead try to reopen +-the connection. ++the connection. The \fBmaxfail\fR option still has an effect on ++persistent connections. + .TP + .B plugin \fIfilename + Load the shared library object file \fIfilename\fR as a plugin. This --- ppp-2.4.1.uus.orig/debian/patches/008_pathnames.h.diff +++ ppp-2.4.1.uus/debian/patches/008_pathnames.h.diff @@ -0,0 +1,11 @@ +--- ppp-2.4.0b4.orig/pppd/pathnames.h ++++ ppp-2.4.0b4/pppd/pathnames.h +@@ -26,7 +26,7 @@ + #define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" + #define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" + #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." +-#define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" ++#define _PATH_CONNERRS _ROOT_PATH "/var/log/ppp-connect-errors" + #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" + #define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" + --- ppp-2.4.1.uus.orig/debian/patches/007_ipcp.h.diff +++ ppp-2.4.1.uus/debian/patches/007_ipcp.h.diff @@ -0,0 +1,13 @@ +--- ppp-2.4.0b4.orig/pppd/ipcp.h ++++ ppp-2.4.0b4/pppd/ipcp.h +@@ -70,4 +70,10 @@ + + char *ip_ntoa __P((u_int32_t)); + ++/* Added to allow static and dynamic ip(s). ++ * Holds the static ip from pap-secrets ++ */ ++u_int32_t staticaddr; ++/******************************************/ ++ + extern struct protent ipcp_protent; --- ppp-2.4.1.uus.orig/debian/patches/010_scripts_README.diff +++ ppp-2.4.1.uus/debian/patches/010_scripts_README.diff @@ -0,0 +1,20 @@ +--- ppp-2.4.0b4.orig/scripts/README ++++ ppp-2.4.0b4/scripts/README +@@ -141,3 +141,17 @@ + are escaped. This may need to be modified depending on the ssh (or + pseudo-tty) implementation which may differ across platforms, for further + optimizations. ++ ++------------------------------------------------------------------------ ++ ++12. pon, poff and ip-up ++ ++These are modified version of the pon/poff/ip-up scripts contributed by Yann ++Dirson . They allow you to call "pon quick" respectively ++"pon quick my-isp" to just call the provider for running you ip-up scripts in ++/etc/ppp/ip-up.d. This can be useful to check for incoming/flush outgoing ++mail, without the necessary delay before hangup introduced by diald or such. ++ ++These scripts break the possibility to connect to multiple ISPs at once, so ++they are included only here. ++ --- ppp-2.4.1.uus.orig/debian/patches/011_scripts_redialer.diff +++ ppp-2.4.1.uus/debian/patches/011_scripts_redialer.diff @@ -0,0 +1,152 @@ +--- ppp-2.4.0b4.orig/scripts/redialer ++++ ppp-2.4.0b4/scripts/redialer +@@ -1,96 +1,69 @@ + #!/bin/sh +-################################################################### + # +-# These parameters control the attack dialing sequence. ++# A chatscript that will attempt to dial multiple numbers in sequence, until ++# you get connected. + # +-# Maximum number of attempts to reach the telephone number(s) +-MAX_ATTEMPTS=10 +- +-# Delay between each of the attempts. This is a parameter to sleep +-# so use "15s" for 15 seconds, "1m" for 1 minute, etc. +-SLEEP_DELAY=15s +- +-################################################################### ++# To use: edit /etc/peers/provider, and change the connect line to read: ++# connect "/usr/local/bin/redialer" + # +-# This is a list of telephone numbers. Add new numbers if you wish +-# and see the function 'callall' below for the dial process. +-PHONE1=555-1212 +-PHONE2=411 ++# See below for configuration. + +-################################################################### ++# This is a list of chatscripts to use to get connected, and (optional) ++# telephone numbers to call for each of those chatscripts. + # +-# If you use the ppp-on script, then these are passed to this routine +-# automatically. There is no need to define them here. If not, then +-# you will need to set the values. +-# +-ACCOUNT=my_account_name +-PASSWORD=my_password ++# Note that in the chatscripts, you may use #NUMBER#, this will be replaced ++# with the number it is calling. You might want to use this to only have one ++# chatscript that is used for all numbers, or you might need multiple ++# chatscripts. + +-################################################################### +-# +-# Function to initialize the modem and ensure that it is in command +-# state. This may not be needed, but it doesn't hurt. +-# +-function initialize +-{ +- chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK' +- return +-} ++PHONE1=123456789 ++CHAT1=/etc/chatscripts/provider + +-################################################################### +-# +-# Script to dial a telephone +-# +-function callnumber +-{ +-chat -v \ +- ABORT '\nBUSY\r' \ +- ABORT '\nNO ANSWER\r' \ +- ABORT '\nRINGING\r\n\r\nRINGING\r' \ +- '' ATDT$1 \ +- CONNECT '' \ +- ogin:--ogin: $ACCOUNT \ +- assword: $PASSWORD +-# +-# If the connection was successful then end the whole script with a +-# success. +-# +- if [ "$?" = "0" ]; then +- exit 0 +- fi ++PHONE2=912345678 ++CHAT2=/etc/chatscripts/provider + +- return +-} ++PHONE3=891234567 ++CHAT3=/etc/chatscripts/provider + +-################################################################### +-# +-# Script to dial any telephone number +-# +-function callall +-{ +-# echo "dialing attempt number: $1" >/dev/console +- callnumber $PHONE1 +-# callnumber $PHONE2 +-} ++PHONE4=789123456 ++CHAT4=/etc/chatscripts/provider + +-################################################################### +-# +-# Initialize the modem to ensure that it is in the command state +-# +-initialize +-if [ ! "$?" = "0" ]; then +- exit 1 +-fi ++PHONE5=001234567 ++CHAT5=/etc/chatscripts/provider + ++# How long to sleep between retries: + # +-# Dial telephone numbers until one answers +-# ++# Note that this is a parameter to sleep so use "15s" for 15 seconds, ++# "1m" for 1 minute, etc ++SLEEP_DELAY=1s ++ ++# The code below does the dialing. ++ + attempt=0 + while : ; do +- attempt=`expr $attempt + 1` +- callall $attempt +- if [ "$attempt" = "$MAX_ATTEMPTS" ]; then +- exit 1 +- fi +- sleep "$SLEEP_DELAY" ++ attempt=`expr $attempt + 1` ++ NUMBER=`eval echo '$PHONE'$attempt` ++ CHAT=`eval echo '$CHAT'$attempt` ++ if [ ! "$CHAT" ]; then ++ attempt=0 ++ else ++ logger "Dialing attempt number: $attempt" ++ sed s/#NUMBER#/$NUMBER/ $CHAT >/etc/chatscripts/tmpchat ++ /usr/sbin/chat -v -f /etc/chatscripts/tmpchat ++ rm -f /etc/chatscripts/tmpchat ++ case $? in ++ 0) logger Connection established ; exit 0;; ++ 1) logger chat: exit 1, see manpage for details. ; exit 1;; ++ 2) logger chat: exit 2, see manpage for details. ; exit 2;; ++ 3) logger chat: exit 3, see manpage for details. ;; ++ 4) logger Line busy. ;; ++ 5) logger No Carrier. ;; ++ 6) logger A call is coming. Exiting! ; exit 1;; ++ 7) logger No dialtone. ;; ++ 8) logger An error occured. Exiting! ; exit 1;; ++ *) logger chat: exit $?, see manpage for details. ;; ++ esac ++ logger "Waiting $SLEEP_DELAY seconds before next try." ++ sleep $SLEEP_DELAY ++ fi + done --- ppp-2.4.1.uus.orig/debian/patches/013_scripts_ip-up.diff +++ ppp-2.4.1.uus/debian/patches/013_scripts_ip-up.diff @@ -0,0 +1,48 @@ +--- ppp-2.4.0b4.orig/scripts/ip-up ++++ ppp-2.4.0b4/scripts/ip-up +@@ -0,0 +1,45 @@ ++#!/bin/sh ++# ++# $Id: ip-up,v 1.1 1997/12/16 11:37:26 phil Exp $ ++# ++# This script is run by the pppd after the link is established. ++# It should be used to add routes, set IP address, run the mailq ++# etc. ++# ++# This script is called with the following arguments: ++# Arg Name Example ++# $1 Interface name ppp0 ++# $2 The tty ttyS1 ++# $3 The link speed 38400 ++# $4 Local IP number 12.34.56.78 ++# $5 Peer IP number 12.34.56.99 ++ ++# The environment is cleared before executing this script ++# so the path must be reset ++PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin ++export PATH ++# These variables are for the use of the scripts run by run-parts ++PPP_IFACE="$1" ++PPP_TTY="$2" ++PPP_SPEED="$3" ++PPP_LOCAL="$4" ++PPP_REMOTE="$5" ++export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE ++ ++# as an additional convienince, $PPP_TTYNAME is set to the tty name, ++# stripped of /dev/ (if present) for easier matching. ++PPP_TTYNAME=`/usr/bin/basename "$2"` ++export PPP_TTYNAME ++ ++# Main Script starts here ++ ++run-parts /etc/ppp/ip-up.d ++ ++# if pon was called with the "quick" arg, stop ppp now ++if [ -r /var/run/ppp-quick ] ++then ++ wait ++ /usr/bin/poff ++fi ++ ++# last line --- ppp-2.4.1.uus.orig/debian/patches/014_scripts_poff.diff +++ ppp-2.4.1.uus/debian/patches/014_scripts_poff.diff @@ -0,0 +1,29 @@ +--- ppp-2.4.0b4.orig/scripts/poff ++++ ppp-2.4.0b4/scripts/poff +@@ -0,0 +1,26 @@ ++#!/bin/sh ++ ++# Lets see how many pppds are running.... ++set -- `cat /var/run/ppp*.pid 2>/dev/null` ++ ++case $# in ++ 0) # pppd only creates a pid file once ppp is up, so let's try killing pppd ++ # on the assumption that we've not got that far yet. ++ killall pppd ++ ;; ++ 1) # If only one was running then it can be killed (apparently killall ++ # caused problems for some, so lets try killing the pid from the file) ++ kill $1 ++ ;; ++ *) # More than one! Aieehh.. Dont know which one to kill. ++ echo "More than one pppd running. None stopped" ++ exit 1 ++ ;; ++esac ++ ++if [ -r /var/run/ppp-quick ] ++then ++ rm -f /var/run/ppp-quick ++fi ++ ++exit 0 --- ppp-2.4.1.uus.orig/debian/patches/015_scripts_pon.diff +++ ppp-2.4.1.uus/debian/patches/015_scripts_pon.diff @@ -0,0 +1,12 @@ +--- ppp-2.4.0b4.orig/scripts/pon ++++ ppp-2.4.0b4/scripts/pon +@@ -0,0 +1,9 @@ ++#!/bin/sh ++ ++if [ "$1" = "quick" ] ++then ++ touch /var/run/ppp-quick ++ shift ++fi ++ ++/usr/sbin/pppd call ${1:-provider} --- ppp-2.4.1.uus.orig/debian/patches/016_chat_manpage.diff +++ ppp-2.4.1.uus/debian/patches/016_chat_manpage.diff @@ -0,0 +1,36 @@ +--- ppp-2.4.0.orig/chat/chat.8 Mon Sep 6 17:10:23 1999 ++++ ppp-2.4.0/chat/chat.8 Sun Feb 25 17:11:27 2001 +@@ -154,7 +154,7 @@ + .IP + # Now wait for the prompt and send logout string + .br +-\'# ' logout ++\&'# ' logout + .LP + + .SH SENDING DATA FROM A FILE +@@ -216,7 +216,7 @@ + .br + SAY "Dialling your ISP...\\n" + .br +-\'' ATDT5551212 ++\&'' ATDT5551212 + .br + TIMEOUT 120 + .br +@@ -326,13 +326,13 @@ + .br + CONNECT \\c + .br +-\'Callback login:' call_back_ID ++\&'Callback login:' call_back_ID + .br + HANGUP OFF + .br + ABORT "Bad Login" + .br +-\'Callback Password:' Call_back_password ++\&'Callback Password:' Call_back_password + .br + TIMEOUT 120 + .br --- ppp-2.4.1.uus.orig/debian/patches/026_pppd.8-active-filter.diff +++ ppp-2.4.1.uus/debian/patches/026_pppd.8-active-filter.diff @@ -0,0 +1,14 @@ +# the manpage is slightly unclear here. +--- ppp-2.4.1.orig/pppd/pppd.8 Tue Mar 13 18:54:37 2001 ++++ ppp-2.4.1/pppd/pppd.8 Wed Nov 7 20:31:44 2001 +@@ -190,9 +190,7 @@ + except that qualifiers which are inappropriate for a PPP link, such as + \fBether\fR and \fBarp\fR, are not permitted. Generally the filter + expression should be enclosed in single-quotes to prevent whitespace +-in the expression from being interpreted by the shell. This option +-is currently only available under NetBSD, and then only +-if both the kernel and pppd were compiled with PPP_FILTER defined. ++in the expression from being interpreted by the shell. + .TP + .B allow-ip \fIaddress(es) + Allow peers to use the given IP address or subnet without --- ppp-2.4.1.uus.orig/debian/patches/027_child_debugging.diff +++ ppp-2.4.1.uus/debian/patches/027_child_debugging.diff @@ -0,0 +1,13 @@ +--- ppp-2.4.0/pppd/main.c.reap Thu Jul 6 07:17:02 2000 ++++ ppp-2.4.0/pppd/main.c Thu Nov 9 17:41:30 2000 +@@ -1579,7 +1579,8 @@ + (chp? chp->prog: "??"), pid, WTERMSIG(status)); + } else if (debug) + dbglog("Script %s finished (pid %d), status = 0x%x", +- (chp? chp->prog: "??"), pid, status); ++ (chp? chp->prog: "??"), pid, ++ WIFEXITED(status) ? WEXITSTATUS(status) : status); + if (chp && chp->done) + (*chp->done)(chp->arg); + if (chp) + --- ppp-2.4.1.uus.orig/debian/patches-applied +++ ppp-2.4.1.uus/debian/patches-applied @@ -0,0 +1,40 @@ +debian/patches/001_udeb.diff +debian/patches/002_chat.c.diff +debian/patches/003_cbcp.diff +debian/patches/004_auth.c.diff +debian/patches/005_fsm.c.diff +debian/patches/006_ipcp.c.diff +debian/patches/007_ipcp.h.diff +debian/patches/008_pathnames.h.diff +debian/patches/009_SETUP.diff +debian/patches/010_scripts_README.diff +debian/patches/011_scripts_redialer.diff +debian/patches/012_secure-card.diff +debian/patches/013_scripts_ip-up.diff +debian/patches/014_scripts_poff.diff +debian/patches/015_scripts_pon.diff +debian/patches/016_chat_manpage.diff +debian/patches/017_memory_management.diff +debian/patches/018_ip-up_option.diff +debian/patches/020_IPPROTO_TCP_undefine.diff +debian/patches/021_setipaddr.diff +debian/patches/022_lockfile-fix.diff +debian/patches/023_lcp-max-termintate.diff +debian/patches/024_pppd.8-persist-maxfail.diff +debian/patches/025_packet_count.diff +debian/patches/026_pppd.8-active-filter.diff +debian/patches/027_child_debugging.diff +debian/patches/028-cbcp-readmes.diff +debian/patches/029-cbcp-scripsandconf.diff +debian/patches/030-cbcp-auth.c.diff +debian/patches/031-cbcp-cbcp.c.diff +debian/patches/032-cbcp-cbcp.h.diff +debian/patches/033-cbcp-ipcp.c.diff +debian/patches/034-cbcp-ipv6cp.c.diff +debian/patches/035-cbcp-ipxcp.c.diff +debian/patches/036-cbcp-lcp.c.diff +debian/patches/037-cbcp-main.c.diff +debian/patches/038-cbcp-options.c.diff +debian/patches/039-cbcp-patchlevel.h.diff +debian/patches/040-cbcp-pppd.h.diff +debian/patches/041-cbcp-tty.c.diff --- ppp-2.4.1.uus.orig/debian/rules +++ ppp-2.4.1.uus/debian/rules @@ -0,0 +1,157 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# merged with old ppp makefile. GNU copyright 1998 by Philip Hands. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 +export DH_COMPAT=3 + +# package build dir. +builddir = $(CURDIR)/debian/ppp +builddir-udeb = $(CURDIR)/debian/ppp-udeb + +# patching stuff +patches=debian/patches-applied + +# Various collections of files for use with dh_* tools. +DOCS=README.linux FAQ README SETUP PLUGINS README.MSCHAP80 README.cbcp \ + debian/README.STATIC-IP debian/README.win9x \ + debian/kernel.fix-2.0.30-2 README.CBCP.en README.CBCP.hu \ + README.CBCP.install.en README.CBCP.install.hu +EXAMPLES=scripts/ +CHANGELOGS=debian/changelog-from-README Changes-2.3 + + +# Compile source. +build: build-stamp +build-stamp: + dh_testdir + # have to do make clean since udeb and deb build in same area + -$(MAKE) clean + ./configure + $(MAKE) USE_PAM=y FILTER=y HAVE_INET6=y COPTS="-DLOG_PPP=LOG_LOCAL2" + touch $@ + +# Compile cut-down source for a udeb +build-udeb: build-stamp-udeb +build-stamp-udeb: + dh_testdir + # udeb clean: + # have to do make clean since udeb and deb build in same area + -$(MAKE) clean + ./configure + $(MAKE) COPTS="-DLOG_PPP=LOG_LOCAL2" UDEB_CFLAGS="-Os -fomit-frame-pointer -UPPP_FILTER -UHAVE_MULTILINK" + touch $@ + + +# +# clean source tree +# +clean: + dh_testdir + test -f $(patches) # maintainer sanity check + -$(MAKE) dist-clean + -$(RM) build-stamp-udeb build-stamp + dh_clean debian/changelog-from-README + + +binary-indep: +# We have nothing to do, no architecture-independent packages here. + + +# +# Build the package! +# +binary-arch: ppp ppp-udeb +ppp: build + # dh_testversion + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install DESTDIR=$(builddir) MANDIR='$$(DESTDIR)/usr/share/man' + + cd $(builddir)/etc/ppp && rm -f pap-secrets chap-secrets + + cp include/net/pppio.h include/net/*compress.h $(builddir)/usr/include/net + cd debian && install -m644 options options.ttyXX no_ppp_on_boot $(builddir)/etc/ppp + cd debian && install -m755 ip-up ip-down $(builddir)/etc/ppp + cd debian && install -m755 pon plog poff $(builddir)/usr/bin + cd debian && install -m644 pon.1 $(builddir)/usr/share/man/man1 + cd etc.ppp && install -m600 callback-users $(builddir)/etc/ppp + cd scripts && install -m700 callback-client $(builddir)/etc/ppp + cd scripts && install -m700 callback-server $(builddir)/etc/ppp + cd $(builddir)/usr/share/man/man1 && ln -s pon.1 poff.1 && ln -s pon.1 plog.1 + # install template files. + install -m644 etc.ppp/chap-secrets debian/pap-secrets debian/provider.peer debian/provider.chatscript $(builddir)/usr/share/ppp/ + + { echo "Changelog extracted from README file:" ; echo ; sed -e "/^What's new in ppp-/,/package, see the Changes-2.3 file./!d" README ; } > debian/changelog-from-README + + dh_installdocs -p$@ $(DOCS) + dh_installexamples $(EXAMPLES) + dh_installchangelogs -p$@ $(CHANGELOGS) + dh_installmodules -p$@ + dh_installinit --no-restart-on-upgrade --update-rcd-params='start 14 2 3 4 5 . stop 14 0 1 6 .' + cp pppd/ppp.pam $(builddir)/etc/pam.d/ppp + dh_strip + dh_compress + dh_fixperms + chmod -R g-ws $(builddir) + # Special permissions + chown root.dip $(builddir)/usr/sbin/pppd + chmod 4754 $(builddir)/usr/sbin/pppd + chown root.dip $(builddir)/etc/ppp $(builddir)/etc/ppp/peers $(builddir)/etc/chatscripts + chmod 750 $(builddir)/etc/ppp + chmod 2750 $(builddir)/etc/ppp/peers $(builddir)/etc/chatscripts + dh_shlibdeps + dh_gencontrol -p$@ + dh_installdeb + dh_md5sums + dh_builddeb -p$@ + +PACKAGE=ppp-udeb +VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) +ARCH=$(shell dpkg --print-architecture) +FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb +PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2) + + +ppp-udeb: build-udeb + mkdir -p ./debian/$@ + $(MAKE) install DESTDIR=$(builddir-udeb) + $(RM) -r $(builddir-udeb)/usr/man/ + $(RM) -r $(builddir-udeb)/usr/sbin/pppdump + $(RM) -r $(builddir-udeb)/usr/sbin/pppstats + @echo "Building $@" + dh_testdir + dh_testroot + dh_installdirs + dh_strip -p$@ + dh_compress -p$@ + dh_fixperms -p$@ + dh_installdeb -p$@ + dh_shlibdeps -p$@ + # Don't write your stupid guesses to debian/files. + dh_gencontrol -p$@ -- -fdebian/files~ + # Register file manually. + dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY) + dh_md5sums -p$@ + dh_builddeb -p$@ --filename=$(FILENAME) + + +# Various source manipulation +patch: + test ! -f $(patches) # already patched + ls debian/patches/* >$(patches) + (for i in `cat $(patches)`;do cat $$i | patch -p1; done) + +unpatch: + test -f $(patches) # not patched + (for i in `tac $(patches)`;do cat $$i | patch -Rp1;done) + -$(RM) $(patches) + + +binary: binary-indep binary-arch +.PHONY: binary binary-arch binary-indep clean + --- ppp-2.4.1.uus.orig/debian/changelog +++ ppp-2.4.1.uus/debian/changelog @@ -0,0 +1,732 @@ +ppp (2.4.1.uus-5) unstable; urgency=low + + * Added real CBCP support by PÁSZTOR György: used ppp-cbcp.sf.net's + stuff + + -- Pásztor György Sat, 29 Jun 2002 18:31:55 +0200 + +ppp (2.4.1.uus-4) unstable; urgency=low + + * Use MAKEDEV in postinst, not mknod. (Closes: #122574) + + -- Michael Beattie Tue, 11 Dec 2001 00:24:05 +1300 + +ppp (2.4.1.uus-3) unstable; urgency=low + + * Enhanced init script for restarting connection. + * removed debconf note, the specifics are in README.Debian, + which should be read by users anyway. (Closes: #118871) + * Removed postinst question about very very old and obsolete + /etc/ppp/ppp-connect + * Removed debian/suid + * Updated README.Debian with info about ppp packet filtering, + and ipv6 support + * Added "active-filter" with a description to /etc/ppp/options + + -- Michael Beattie Mon, 12 Nov 2001 19:15:08 +1300 + +ppp (2.4.1.uus-2) unstable; urgency=low + + * Added versioned build dependency on debhelper (Closes: #117497) + * Enabled IPV6 support (Closes: #117727) + * Changed /etc/init.d/ppp to fully stop and restart pppd. + Not just signal a redial. (Closes: #117220) + * Corrected pppd(8) with respects to the active-filter option. + (Closes: #116809) + * Applied patch from Russell Coker to add extra debugging info for + child processes + + -- Michael Beattie Wed, 7 Nov 2001 20:53:26 +1300 + +ppp (2.4.1.uus-1) unstable; urgency=low + + * The Lets-get-rid-of-dbs release. Now using perl's patching method. + "uus" in upstream version to allow replacement of current 2.4.1 source + package. (unadulterated upstream source) + * Fixes to memory management patch (Closes: #113323, #106913, #111052) + * Removed kernel mode pppoe patch. Breaks demand dialling. Upstream + is planning on native pppoe support for 2.4.2 (Closes: #103843) + * Enabled PPP packet filtering. (Closes: #111522) + * Added Russian debconf template. (Closes: #112654) + * Completely remove /etc/ppp and /etc/chatscripts on purge, instead of + just removing selected files within. (Closes: #107910) + + -- Michael Beattie Sat, 29 Sep 2001 23:15:44 +1200 + +ppp (2.4.1-4) unstable; urgency=medium + + * Fixed lockfile handling for devfs. (Closes: #103794) + * Added dependency on procps. (Closes: #104066) + * Added patch to count packets on linux. (Closes: #104276) + * Added patch for more memory management fixes (Closes: #104275) + + -- Michael Beattie Sat, 21 Jul 2001 18:11:53 +1200 + +ppp (2.4.1-3) unstable; urgency=low + + * Removed signal handling patch. causes breakage on many (almost all) + configurations different to Daniel's (holdoff 0, persist). Bug reopened. + * Added patch from Russell Coker to add option to specify ip-up script. + (Closes: #101587) + * Added patch (slightly modified) from Russell Coker that fixes compile + time warning. Not overly worrying, but what the hell. (Closes: #101584) + * Added patch from Russell Coker to make setipaddr() available for + portslave (Closes: #101830) + * Modified utils.c to correctly build a lockfile when using devfs. + (Closes: #101372, #101754) + * Added Spanish debconf Template. Thanks to Carlos Valdivia. + (Closes: #102636) + * Correctly check f->maxtermtransmits in fsm.c so that lcp-max-terminate + is honoured. (Closes: #98728) + * Added reference to maxfail option from persist description in manpage. + (Closes: #102313) + + -- Michael Beattie Thu, 5 Jul 2001 00:04:54 +1200 + +ppp (2.4.1-2) unstable; urgency=low + + * Using fixed debhelper, update-modules now only gets called if it is + actally available. (Closes: #94682) + * Removed start-stop-daemon call in prerm, dh_installinit does this now. + * removed suidunregister calls in postrm (oops) + * Added pppoe patch, we can now use kernel mode pppoe :> - Paul says he's + working on a better patch for 2.4.2, but I want pppoe for my own + purposes... go figure. (Closes: #88844) + * Added patch from Daniel Ginsburg for signal handling bug. + (Closes: #100028) + + -- Michael Beattie Sat, 16 Jun 2001 06:24:35 +1200 + +ppp (2.4.1-1) unstable; urgency=low + + * New upstream release + * get-up-to-date upload, before trying to squash a lot of the annoying bugs + against ppp. + * Added build dependency on debhelper. Closes: #68692, #68751 + * Creating udeb for debian-installer. Thanks to David Whedon. + Closes: #79864 + * check for location of kill in poff, to account for occasional brokeness + of procps. Joey Hess suggested a simple "kill", and let PATH do the + rest, but I feel that may break in some cases. Closes: #82771 + * Added Swedish, German, French, Dutch and Portuguese templates for debconf. + Thanks to André Dahlqvist, Joerg Rieger, Thomas Morin, Ivo Timmermans, + and Carlos Laviola. Closes: #83281, #84264, #83797, #92534, #93220 + * Fixed Bad characters in chat manpage. Closes: #75921 + * Added Patch to fix memory leak. Closes: #93371 + * Stopped using suidmanager. + + -- Michael Beattie Tue, 8 Aug 2000 23:13:58 +1200 + +ppp (2.4.0f-1) unstable; urgency=low + + * New upstream release + * New version Closes: #23784 + * Fixed postinst paper bag bug. Closes: #68673, #68682, #68668, #68684 + (I love it when people dont look to see if a bug is already reported.) + * Removed PATH definition from /etc/init.d/ppp. Closes: #66171 + * modified plog to also grep for 'chat[' if tailing syslog. + + -- Michael Beattie Mon, 7 Aug 2000 17:10:50 +1200 + +ppp (2.4.0b4-1) unstable; urgency=low + + * New upstream release + * New maintainer + * Added postinst section to create /dev/ppp. Closes: #65086 + * Added patches to pon from Josip Rodin to allow extra parameters to + pppd. also uses /etc/ppp/ppp_on_boot if present and executable. + Closes: #66778 + * Updated pon.1 to reflect above. Thanks Josip. + * Tidied Debian patches. Closes: #63678 + * Moved to doogie's dbs package format. + * Acknowledged NMU Patches. Again, thanks Josip. Closes: #58216, #60356 + * Adjusted plog to tail syslog, if ppp.log exists, but is zero-length + * Made pppd world readable. Closes: #60014 + + -- Michael Beattie Fri, 28 Jul 2000 20:37:14 +1200 + +ppp (2.3.11-1.4) frozen unstable; urgency=low + + * NMU, fixed usage of dpkg --compare-versions. $2 in the install scripts + is empty if this is the first time ppp is installed. This caused some + spurious output (not sure if it caused a failure or not, but it is + definitely broken). + + -- Ben Collins Thu, 30 Mar 2000 08:45:17 -0500 + +ppp (2.3.11-1.3) frozen unstable; urgency=low + + * Conditionalized suidunregister call in preinst, closes: 60330. + [several merged important bugs] + + -- Josip Rodin Tue, 14 Mar 2000 13:13:57 +0100 + +ppp (2.3.11-1.2) frozen unstable; urgency=low + + * Non-maintainer upload, approved by the maintainer. + * Remove the suidregister mess caused by file diversions in old packages + in preinst, closes: #57933. + * Don't ship {chap,pap}-secrets or `provider' chatscript/peer file as + conffiles, but as examples. Everybody needs to modify these files to + use them, so dpkg conffile prompt gets to be annoying. Instead, if these + files don't already exist in their regular locations, install these + examples in postinst, and remove them in postrm on purge, closes: #58170. + * Fixed a couple of typos in docs/comments, and explicitely tightened + some permissions. Updated the copyrights and licenses (yuck! yuck! yuck!). + * Default value for number of redial attempts with persist option was + changed from 0 to 10 upstream by introducing a new `maxfail' option. + It won't be reverted because it can cause unpredictable results, so + a note (with rationale) was added: in README.Debian, and in postinst + through debconf or if debconf doesn't exist, through normal cat/read, + closes: #51588. (added Suggests: debconf to control file for that) + * Added the following commented out options with descriptions to the + options file: maxfail, nopersist, persist, demand, idle, holdoff, + connect-delay. + * Partially fixed bug #48478 in plog, by making it tail /var/log/syslog, + grepping for ' pppd\[', if /var/log/ppp.log is not found. Maybe it + should print out a warning message about local2, not sure. Added a note + in plog(1) about the local2.*\t-/var/log/ppp.log in /etc/syslog.conf. + * If they exist, chown root.adm and chmod 640 ppp.log and ppp-connect-errors + files in /var/log, with postinst, just in case (the former file will be + set up that way by sysklogd's daily cron). + + -- Josip Rodin Wed, 16 Feb 2000 14:25:22 +0100 + +ppp (2.3.11-1.1) frozen unstable; urgency=medium + + * Non-maintainer upload. + * Made preinst script properly remove diversions and diverted files + from both older versions of ppp-pam, closes: #50723, #38732, #57855. + * Init script now runs poff to stop and/or restart properly, + closes: #56962, #39494. + * Marked /etc/chatscripts as a suid directory, root.dip 2750, + closes: #53493. + * Used most of the ideas from Petr Slansky for a + customizable ppp_on_boot file, while maintaining compatibility with + people's old non-runnable ppp_on_boot files, closes: #45424. + * Cleaned up, updated and/or renamed most of the documentation and + examples, closes: #47570, #57853 (first part). + * Added missing .TP near the `nomagic' description in pppd(8), + closes: #52925 (note: the IPv6 thing might still be wrong, didn't test). + * Increased chat REPORT buffer, with patch from the bug report, + closes: #57467. + * Added a Replaces: on ppp-pam, so dpkg can ditch it properly + (Conflicts+Replaces), the second part of second part of #57853. :) + * Added check whether $1 is remove or purge in postrm, the third part + of #57853. + * Changed s/tail $*/exec tail "$@"/ in plog, and added the exec in pon. + * Fixed some minor errors in the pon(1) manual page, added files' + descriptions. + * Added Build-Depends: libpam0g-dev, updated for Policy 3.1.1. + Used tmp directory abstraction in the rules file. Removed several + cruft files from debian/. + * Noting bugs fixed in 2.3.11-1, by Phil: + + new upstream version closes: #57062. + + ppp-pam merge back into ppp, as the base system now includes PAM, + closes: #48237. + + marked /etc/pam.d/ppp as conffile, closes: #48387 (that report + doesn't seem to exist...?). + + -- Josip Rodin Sat, 12 Feb 2000 00:15:43 +0100 + +ppp (2.3.11-1) frozen unstable; urgency=medium + + * New upstream release + * get rid of ppp/ppp-pam split now that PAM is in base + * fix spelling of debian/ppp-pam.conffiles. Doh! (closes: 48387) + * while I have a feeling that several of the bugs reported against + ppp are fixed by this upstream, I've not had time to confirm it, + so it may be best to wait for favourable reports, or an NMU, since + I'm off on holiday later today and won't be able to do any more + for a week. + + -- Philip Hands Fri, 11 Feb 2000 04:06:44 +0000 + +ppp (2.3.10-2) unstable; urgency=low + + * apply patch from Ben Collins (closes: #38639, #37869) + * add dependency ppp-pam --> libpam-modules (closes: #47563) + + -- Philip Hands Mon, 25 Oct 1999 14:38:41 +0100 + +ppp (2.3.10-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Mon, 11 Oct 1999 23:49:14 +0100 + +ppp (2.3.9-1) unstable; urgency=low + + * New upstream release (closes: #42030) + * applied upstream ppp-2.3.9-patch1 + * remove bash-isms from debian/rules (closes: #43262) + * change all references to /dev/cua* to /dev/ttyS* (closes: #43487) + * add a version dependency on sysvinit (closes: #41233) + * handle non-existent {pap,chap}-secrets (closes: #40884, #36859) + * /etc/pam.d/ppp now uses pam_unix.o ** NEEDS TESTING ** (closes: #39230) + + -- Philip Hands Sat, 28 Aug 1999 22:22:36 +0100 + +ppp (2.3.8-1) unstable; urgency=low + + * New upstream release + * revert to upstream pppstats code. Hopefully (closes: #39091) + * make sure /etc/ppp ends up belonging to root.dip + (closes: #39116, #39558, #39060, #38833, #38824, #38823, #38775, #38682, + #40717) + * stop postinst from editing /etc/syslog.conf (closes: #38769) + * postinst no longer worries if ``provider'' files don't exist + (closes: #38768) + * patch pppd/fsm.c to stop LCP terminate requests when lcp-max-terminate + is 0 (closes: #23734) + * add cbcp support + + -- Philip Hands Wed, 30 Jun 1999 21:10:53 +0100 + +ppp (2.3.7-4) unstable; urgency=low + + * make use of debhelper's new ability to suidregister directories + * fixed poff's ps|grep call (closes: #35661, #38418) + * dh_suidregister bug now fixed (closes: #35673, #35718, #37708) + * change chgrp dip's to chown root.dip's in rules, to get round some + dh_suidregister/fakeroot weirdness + + And from an NMU by Christian Kurz + * Applied patch from Torsten Landschoff (closes: #35064, #35180, + #35817, #35857, #36557) + * Applied patch from Harmut Koptein (closes: #38289) + + -- Philip Hands Sun, 30 May 1999 10:40:34 +0100 + +ppp (2.3.7-3) unstable; urgency=low + + * New pon.1 man page from Othmar Pasteka. + * set perms on etc/ppp (and some others) in postinst + this _really_ (closes: #35348) + + -- Philip Hands Mon, 5 Apr 1999 10:36:17 +0100 + +ppp (2.3.7-2) unstable; urgency=low + + * set flags to 1 for hide_password in upap.c, so it actually gets set. + * remove Christian's bogus preinst + + Changes for 2.3.7-1, which was broken, so was not published: + * New upstream release + + Christian Kurz's changes for 2.3.6-1.1: + * ppp-manual rewritten (closes: #14133) + * upstream release of chat fixed (closes: #16267) + * routing is set up correct (closes: #17287) + * poff allows to specifiy the process to kill (closes: #17410) + * ppp now works with the newest kernels (closes: #20091, #29964) + * ppp should suggest pppconfig is obsolete, because both are base files + (closes: #20143) + * ppp won't install is solved (closes: #20708) + * ppp based on the new upstream release (closes: #22243, #26429 #21921, #22064) + * provider-example changed (closes #18475) + * changed the location of connect-errors (closes: #15483) + * rewrote the redialer-script (closes: #26230) + * fixed permissions of /etc/ppp (closes: #27246) + * use the new pon.1 man page which was written by Othmar Pasteka + * /etc/ppp/options doesn't get overriden (closes: #17543) + * static-ip patch included (closes: #22497) + * pon command works (closes: #22963) + * messages appear now in the logfile (closes: #23868) + * disconnect sequence is correct (closes: #24584) + * upgrading of ppp now works (closes: #25397) + * ip-up/down race condition is removed (closes: #30935) + * poff can be run by the same person as pon (closes #33773) + * ip-up and ip-down won't be executed simultaneously (closes: #34377) + * new poff script (closes: #34927) + * /etc/ppp/options corrected (closes: #29647) + * ppp.log-permission are correct and the logfile is cycled (closes: #25901) + + -- Philip Hands Sat, 3 Apr 1999 16:49:26 +0100 + +ppp (2.3.6-1) unstable; urgency=low + + * New upstream release + * switch to debhelper + * prevent passwords apearing in syslog messages (closes: #20818, #21213, #31218) + * use pon.1 man page written by othmar@tron.priv.at (closes: #19967) + * use John Hasler's revised poff (closes: #25365, #30435, #32365) + * make init.d script use rc?.d number of 14 (closes: #28212) + * add example scripts from Yann Dirson (closes: #16836) + * reduce logging in chat, unless ``verbose'' is set (closes: #24017) + * mention pap-secrets fixup in README.debian (closes: #16905) + * create dummy upstream Changelog (closes: #20187) + * set ppp-pam's priority to optional (closes: #21125) + + -- Philip Hands Mon, 22 Mar 1999 16:00:01 +0000 + +ppp (2.3.5-2) frozen unstable; urgency=low + + * Apply patch from linux-ppp, via Eloy A. Paris, that allows IPX over PPP + * fix default login line in pap-secrets (closes: #23508) + * get rid of cron.daily, since syslogd's cron.weekly is dealing with the + log aging (closes: #22059) + + -- Philip Hands Mon, 15 Jun 1998 17:28:39 +0100 + +ppp (2.3.5-1) frozen unstable; urgency=low + + * make /etc/chatscripts and /etc/ppp/peers SGID (closes: #22501) + * use new poff from steveh@eecs.umich.edu (closes: #22391, #22322, #20994) + + -- Philip Hands Tue, 26 May 1998 10:18:13 +0100 + +ppp (2.3.5-0.1) frozen unstable; urgency=low + + * New upstream bugfix release. + * Non-maintainer release. + + -- Joel Klecker Wed, 13 May 1998 19:36:57 -0700 + +ppp (2.3.3-5) unstable; urgency=low + + * add options to poff, to allow alternative signals to be sent + (closes: #18618) + * rebuild to get rid of spurious diff contents (possible dpkg-dev bug ?) + (closes: #18824) + * add /usr/doc/ppp-pam symlink to point at ppp's docs (closes: #19393) + + -- Philip Hands Mon, 16 Mar 1998 12:01:32 +0000 + +ppp (2.3.3-4) unstable; urgency=low + + * reset logging after PAM grabs it, and make utmp/wtmp happen again + (closes: #18544) + + -- Philip Hands Tue, 24 Feb 1998 11:38:28 +0000 + +ppp (2.3.3-3) unstable; urgency=medium + + * use --quiet in init.d script (closes: #18226) + * fix unchecked prompting in postinst (closes: #12623) + * PAM logins now work (used Cristian Gafton 's patch + which seems to be for a later version of PAM, but worked anyway after + a minor tweak). + * use the /etc/pam.d/ppp file from redhat as well. + + -- Philip Hands Mon, 23 Feb 1998 23:45:16 +0000 + +ppp (2.3.3-2) unstable; urgency=low + + * make ip-(up|down) executable (closes: #11449, #16113) + * put /etc/pam.d/ppp in ppp-pam (closes: #16111) + * add console messages to /etc/init.d/ppp (closes: #16629) + * add IPPARAM to ip-(up|down) (closes: #16695) + * improve comments in ip-(up|down) (closes: #17126) + + -- Philip Hands Tue, 10 Feb 1998 23:47:37 +0000 + +ppp (2.3.3-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Fri, 6 Feb 1998 12:13:33 +0000 + +ppp (2.3.2-3) unstable; urgency=low + + * automate the version dependency in ppp-pam + + -- Philip Hands Thu, 18 Dec 1997 17:14:34 +0000 + +ppp (2.3.2-2) unstable; urgency=low + + * add creation of ppp-pam .deb + * ppp-pam: use libpam0g and add /etc/pam.d/ppp + * add use of run-parts ip-{up,down}.d + + -- Philip Hands Sun, 14 Dec 1997 21:12:58 +0000 + +ppp (2.3.2-1) unstable; urgency=low + + * New upstream release + * get rid of dependence on libpam (closes: #15665) + * applied ms-chap patch from Kent Robotti + + -- Philip Hands Sat, 6 Dec 1997 19:28:42 +0000 + +ppp (2.3.1-6) unstable; urgency=low + + * Fix feeble typo in postinst + + -- Philip Hands Thu, 6 Nov 1997 00:23:09 +0000 + +ppp (2.3.1-5) unstable; urgency=low + + * fix /tmp/$$ security hole in postinst (#11781) + * stop postinst trying to chmod non-existent files (#14519,#14279) + * fix permissions on /usr/include/net/slcompress.h (#14557) + + -- Philip Hands Wed, 5 Nov 1997 12:38:48 +0000 + +ppp (2.3.1-4) unstable; urgency=low + + * unpatch pppstats so that it gets compiled OK with libc6 + + -- Philip Hands Wed, 5 Nov 1997 11:45:10 +0000 + +ppp (2.3.1-3) unstable; urgency=medium + + * re-enable setting of serial port speed (disabled in error) + * fix permissions on /etc/chatscripts (#14166) + * tidy up poff (#14209) + + -- Philip Hands Wed, 29 Oct 1997 00:35:32 +0000 + +ppp (2.3.1-2) unstable; urgency=medium + + * Set Maintainer: to me. + * Add IPX support, and disable it in options + + -- Philip Hands Fri, 25 Jul 1997 03:24:04 +0100 + +ppp (2.3.1-1) experimental; urgency=low + + * Non-Maintainer release: I think it is necessary to get this stuff working soon + and the experimental version still has my maintainer name. + * Updated to "non-beta" release which was advertised as tested (Joke! Joke!). + * Included patch to fix the ppp kernel sourcecode so that it compiles. + * Warning: TCP stalls in a regular fashion. f.e. on an SMTP connection. + If someone wants to fix things. Beats me. + * demand dialing requires kernel ppp sourcecode update or newer kernel (than + available on July 23,1997) + * Shadow password expiration disabled due to + use of non-exported function of the shadow library. + * pppstats does not compile due to incompatibility with kernel 2.0.30 + kernel symbols. + * pppd source patches so that chat-scripts do not stall. + * STATIC IP patches applied + * poff: Do not rely on pid file to kill pppd + * plog: Allow options to be passed on to "tail". + + -- Christoph Lameter Tue, 22 Jul 1997 23:19:23 -0700 + +ppp (2.3b3-3) experimental; urgency=low + + * All changes done to the regular ppp package revisions applied to the + experimental one. + * PAM support + * High baudrate Support + * Shadow support + + -- Christoph Lameter Sat, 5 Apr 1997 21:30:55 -0800 + +ppp (2.3b3-2) experimental; urgency=low + + * ppp compiled with newest debmake and thus suidmanager support + * pppstats does not compile not included + * Note: ppp 2.3b3 is experimental and limited. Will stay in experimental. + Only an upstream release fixing the gaps can make ppp 2.3 advance into + unstable. Bug reports wanted. + * Remove /etc/ppp.chatscript and /etc/ppp.options_out + instead use /etc/ppp/peers/provider and /etc/charscripts/provider + according to new upstream ppp security scheme (about which I am kind of + puzzled right now). + * Modified scripts / init.d according to new security scheme. + * postinst converts from old setup scheme and makes dialup scripts + + options file more secure. + * Permissions on binary were screwed up in -1 release. + + -- Christoph Lameter Thu, 21 Nov 1996 21:32:35 -0800 + +ppp (2.3b3-1) experimental; urgency=low + + * pppd made only executable by group dip + * Upstream upgrade to BETA + + -- Christoph Lameter Fri, 8 Nov 1996 15:13:45 -0800 + +ppp (2.2.0f-17) unstable; urgency=low + + * pppd is not stopped and started on upgrade (only happened with ppp on bootup enabled) + + -- Christoph Lameter Tue, 5 Nov 1996 06:56:35 -0800 + +ppp (2.2.0f-16) unstable; urgency=low + + * chatscript aborts on no dialtone + * stripped pppstats + + -- Christoph Lameter Thu, 24 Oct 1996 10:11:07 -0700 + +ppp (2.2.0f-15) unstable; urgency=low + + * debmake 0.91 applied to ppp + * debmake takes over the /etc/init.d and the postrm stuff. + + -- Christoph Lameter Mon, 21 Oct 1996 18:58:19 -0800 + +ppp (2.2.0f-14) unstable; urgency=low + + * debmake problem with install scripts + + -- Christoph Lameter Thu, 17 Oct 1996 07:20:20 -0800 + +ppp (2.2.0f-13) unstable; urgency=low + + * Added \q after the password in ppp.chatscript + + -- Christoph Lameter Mon, 14 Oct 1996 17:59:45 -0800 + +ppp (2.2.0f-12) unstable; urgency=low + + * Added persist option to default configuration file ppp.options_out + to have pppd keep on dialing until connection is established. + * Added restarting of logging daemons to cron.daily script + + -- Christoph Lameter Sat, 12 Oct 1996 09:00:00 -0800 + +ppp (2.2.0f-11) unstable; urgency=medium + + * Postinst also customizes /etc/ppp/options.ttyXX + * Changed the bad example in /etc/ppp/options.ttyXX. + * Added log rotation + * Fixed persist option in pppd so that it waits 10 seconds before + reconnecting. Otherwise the reconnect attempt fails. + * Do not abort pppd on script failure with the persist option on. + * Added manpages for pon,poff,plog + + -- Christoph Lameter Mon, 7 Oct 1996 09:00:00 -0800 + +ppp (2.2.0f-10) unstable; urgency=medium + + * Tested the automatic-ppp-on-boot function + * Fixed bug in /etc/init.d/ppp (was not compatible with pon) + + -- Christoph Lameter Sun, 6 Oct 1996 09:00:00 -0800 + +ppp (2.2.0f-9) unstable; urgency=medium + + * Convenience scripts ( pon, poff, plog ) to control/monitor link + * Links were not activated in the last change + * Syslog output redirected to a separate file in /var/log/ppp.log + * Updated Documentation in README.debian + * Corrected changelog + * Finally got through to using ppp/mgetty on my home system and + found some inconveniences in the config files. + * moved /etc/ppp/chatscript to /etc/ppp.chatscript since /etc/ppp is not + to be accessed from userspace. + * New configuration file /etc/ppp.options_out for outbound options to + be able to handle mixed (inbound/outbound) usage. + I am not yet satisfied with the mixed setups such as I have at home. + + -- Christoph Lameter Sat, 5 Oct 1996 09:00:00 -0800 + +ppp (2.2.0f-8) unstable; urgency=low + + * links for /etc/init.d/ppp installed again + * pppd will come up on startup if /etc/ppp/ppp_on_boot exists + + -- Christoph Lameter Wed, 2 Oct 1996 09:00:00 -0800 + +ppp (2.2.0f-7) unstable; urgency=low + + * fixed a couple of bugs in postinst script. + * pppd now stripped + * etc/rc.d links for /etc/init.d/ppp not installed anymore + * /etc/init.d revised + + -- Christoph Lameter Wed, 2 Oct 1996 09:00:00 -0800 + +ppp (2.2.0f-6) unstable; urgency=low + + * pppstats program was not included + + -- Christoph Lameter Sun, 29 Sep 1996 09:00:00 -0800 + +ppp (2.2.0f-5) unstable; urgency=low + + * Updated standards + * Updated Documentation in /etc/ppp/options + + -- Christoph Lameter Fri, 27 Sep 1996 09:00:00 -0800 + +ppp (2.2.0f-4) unstable; urgency=low + + * Added example file for options.ttyXX + * Renamed to ppp to merge isp-ppp with ppp + * New maintainer for ppp package + * pppd runs setsuid + + -- Christoph Lameter Wed, 25 Sep 1996 09:00:00 -0800 + +isp-ppp (2.2.0f-2) unstable;urgency=low + + * Added "Conflicts: ppp" to control +isp-ppp (2.2.0f-1) unstable;urgency=low + + * Added pap-secrets file for mgetty integration + * Reworked control + + -- Christoph Lameter Fri, 6 Sep 1996 09:00:00 -0800 + +isp-ppp (2.2.0f-0) unstable;urgency=low + + * Added patch to fix trumpet winsock problems + * Update to standards 2.1.0.0 + * Named package isp-ppp to be able to release alternate pppd into debian + distribution + * pppd installed suid for regular dialup people who want to activate pppd + + -- Christoph Lameter Fri, 6 Sep 1996 09:00:00 -0800 + +Thu Jul 25 22:47:37 PDT 1996 Christoph Lameter + + * Added remote DNS and WINS configuration ability to pppd + ( See comments in /etc/ppp/options) + * Build on top of ppp of Alvar + +Sun Jul 7 17:01:22 BST 1996 Alvar Bray + * Setup to build/install pppstats utility. + * Modified to build on any archticture, Thanks due to + Yambo . + * Version 2.2.0f-3 released. + +Sun May 26 14:28:39 BST 1996 Alvar Bray + * Applied patches from Marek Michalkiewicz + to suport shadow + passwords. + * Added Architecture and priority fields to debian.control. + * Version 2.2.0f-2 released. + +Wed May 1 19:54:15 BST 1996 Alvar Bray + * Updated to upstream version 2.2.0f. + * Changed version to 2.2.0f-1. + +Sat Mar 23 09:39:49 GMT 1996 Alvar Bray + * Modified runlevel change start/kill links. + * Removed symlink /usr/include/net/route.h + * Revision 3 released. + +Tue Jan 30 23:14:51 GMT 1996 Alvar Bray + * used a documemented version of the options file from + source by Jim Knoble + * Removed /etc/ppp/ppp-connect script + * Added /etc/ppp/chatscript called by the options file + * Added empty ip-up and ip-down scripts. + +Sun Jan 28 22:34:09 GMT 1996 Alvar Bray + * Upgraded to version ppp-2.2.0e using CVS + * Renamed package ppp-2.2.0e + +Wed Nov 22 15:31:15 GMT 1995 Alvar Bray + * Rebuilt using elf format - added libc5 dependency. + * Made purge remove all ppp files (bug #1827) + * Added missing kernel header stubs to /usr/include/net + (bug #1795) + * Removed reference to /etc/init.d/functions in + /etc/init.d/ppp (bug #1725) + * Added dependency on netbase (bug #1443) + * New README (bug#1059) + * New source using ppp-2.2.0.c from + sunsite.unc.edu:/pub/Linux/system/Network/serial + +Ian Murdock + * added Debian GNU/Linux package maintenance system files + * changed Makefile variables in chat and pppd directories + + --- ppp-2.4.1.uus.orig/debian/conffiles +++ ppp-2.4.1.uus/debian/conffiles @@ -0,0 +1,7 @@ +/etc/pam.d/ppp +/etc/init.d/ppp +/etc/ppp/options +/etc/ppp/no_ppp_on_boot +/etc/ppp/ip-up +/etc/ppp/ip-down +/etc/ppp/callback-users --- ppp-2.4.1.uus.orig/debian/README.Debian +++ ppp-2.4.1.uus/debian/README.Debian @@ -0,0 +1,224 @@ +Debian PPP package notes +======================== + +Table of contents: + + + Upgrading from versions older than 2.4.1[.uus-3] + + Upgrading from versions older than 2.3.9 *important* + + Upgrading from versions older than 2.3.5-2 + + Upgrading from versions older than 2.3.1 + + PAM support (needed for inbound PAP) + + Provided user space scripts + + Outbound dialing setup + + Inbound setup combined with mgetty + + Permissions + + Demand dial-up links + + Syslog facility level + + Not implemented + + Kernel 2.0.x update + + +Upgrading from versions older than 2.4.1[.uus-3]: +------------------------------------------------- + +PPP packet filtering has been enabled since 2.4.1.uus-2, which is available +by using the "active-filter" option. See pppd(8) for more information. +The CONFIG_PPP_FILTER option is required in the kernel. (If this is not +enabled, the following warning will be sent to the syslog, but ppp will +continue to function: + pppd[pid]: Couldn't set pass-filter in kernel: Invalid argument ) + +IPV6 support has also been enabled, for usage, see the pppd(8) manpage. + +Upgrading from versions older than 2.3.9: +----------------------------------------- + +Default value for number of redial attempts with `persist' option was +changed from infinity to 10, by introducing a new `maxfail' option. + +If you used the `persist' option in your pppd settings, you will have to +add `maxfail 0' to get the old behaviour back. + +(Possible) Rationale: some people had ISDN dial-on-demand routers that were +dialing but failing to authenticate. Because of the pppd setting to dial +infinitely, it happened about once a second, so after a month or two, the +phone bill was several thousand pounds! This is clearly unacceptable, so the +default was changed from infinity to 10 to prevent this and all similar cases. + +Upgrading from versions older than 2.3.5-2: +------------------------------------------- + +Debian package had included an incorrect example of /etc/ppp/pap-secrets +in the inbound connection section. The old wrong example was this: + +# Every regular user can use PPP and has to use passwords from /etc/passwd +* molec3 "" + +This was fixed in ppp package version 2.3.5-2, to: + +# Every regular user can use PPP and has to use passwords from /etc/passwd +* hostname "" * + +Note: the string "hostname" must be replaced with the output of `hostname` +on your system. It will be done by the post-installation scripts, but you +should check it's done nonetheless. + +Upgrading from versions older than 2.3.1: +----------------------------------------- + +The default setup in /etc/ppp/options is to turn authentication on. + +This may cause you not to be able to log into your ISP any more, if they do +not support PAP or CHAP authentication. All you need to do is set ``noauth'' +either on pppd's command line or in /etc/ppp/peers/provider, in order to switch +it off for this connection. + +[Don't just turn it off again in the options file, since it is better to deny + access by default for security reasons.] + +PAM support (needed for inbound PAP): +------------------------------------- + +pppd with PAM support for inbound PAP logins is now available in the +normal `ppp' package, marking the `ppp-pam' package obsolete. The +packaging system should automatically remove the old package on upgrade. + +Provided user space scripts: +---------------------------- + +Since release 2.3.1, the ppp package provides scripts to conveniently +control PPP from user space. Note that the scripts only work with the +proper setup in /etc/ppp. Edit the configuration files and test the +operation of your link in superuser mode first. + +pon Bring link up. Executes pppd (you may specify the ISP name + on the command line), and will immediately return the + command prompt while still dialing. + +plog Shows the last lines of the pppd log. Basically, does + tail ppp.log. + +poff Bring link down. Terminates connection by killing pppd. + +Please read the manual page pon(1) for specific descriptions of these +commands. + +Outbound and inbound dialing setup: +----------------------------------- + +pppd attempts to handle both inbound and outbound through one set of +configuration files. The /etc/ppp/options file has been set up for the +most common setups. + +If it isn't absolutely necessary, please don't edit the file, but specify +parameters on the commandline. If you find a change that would be beneficial +to all users, then please inform the package maintainer about it. + +Outbound dialing setup: +----------------------- + +Edit the file /etc/chatscripts/provider and make sure it contains what +you need to dial-up into your server and eventually start up PPP on the +remote machine. I.e. replace strings in brackets with appropriate values +like telephone number, login name, and password. + +Edit the file /etc/ppp/peers/provider and put all options in it that you need +to connect to your server. The most common options are already provided for +you. If you need the common PAP password authentication then add +`user ' to it. Otherwise you might also change the system name to +be like your username. The systemname is used for authentication if you do +not provide the "user" directive. See also pppd(8) manual page. + +Note: If you are NOT using PAP or CHAP authentication, you need to put + `noauth' in /etc/ppp/peers/provider to allow a connection to be made. + +Edit the file /etc/ppp/pap-secrets and put your password into the designated +location. + +You should then be able to start the PPP connection with pon. + +If you want to have PPP on bootup then rename the file +/etc/ppp/no_ppp_on_boot to /etc/ppp/ppp_on_boot. If you wish to further +customize it, mark it executable and edit it (it's a shell script). + +For more advanced usage of PPP outbound connections install pppconfig. + +Inbound setup combined with mgetty: +----------------------------------- + +Note: for this to work you need to have mgetty version >= 0.99 with its +AutoPPP feature turned on. + +Edit the /etc/ppp/options file and uncomment the nameserver lines. Provide +the IP addresses that you want the users to use for their name services. + +To have one options file for each serial port you run mgetty on, use +the files /etc/ppp/options.ttyXX. Give each serial port an IP address +in those files. That way that port is locked into using that IP number. +Think what consequences that assignment might have for outbound use... + +That should be enough for dial-up from a Win9x or NT Server. The +username/password on those system is used for a PAP authentication. +The /etc/ppp/pap-secrets is already set up for such a situation. Mgetty is +preconfigured to call pppd with parameters so that the PAP verification will +be done through the /etc/passwd file. + +All your users should now be able to establish PPP connections by just +specifying phone number, username, and password from Win9x. + +Inbound dial-up using dial-up scripts: +A PPP session can be established from the regular Linux prompt by executing +/usr/sbin/pppd. The user is limited to use the assigned IP adddress in +/etc/ppp/options.ttyname and will not be able to override it. + +Note: there is support for callback, it can be done through scripts +(see /usr/share/doc/ppp/examples/scripts/*callback), and with mgetty's +`callback' program (see callback(8) manual page). + +Permissions: +------------ + +Access to PPPD is controlled via the membership in the "dip" group. + +Demand dial-up links: +--------------------- + +Note: if you use an older kernel version (older 2.0.x), you need to patch +the kernel itself, in order to support demand dial-up with the patches for +PPP 2.3. + +Add the following options to /etc/ppp/peers/provider: + +demand idle 600 holdoff 20 + +to set up demand dialing. 600 seconds (=10 minutes) idle time disconnects. +20 seconds between attempts to connect. This setup implies the "persist" +option. You might also want to enable PPP on boot up so you won't have to +worry about the PPP connection at all. + +Syslog facility level: +---------------------- + +The default level of LOG_DAEMON has been overridden (as described in the +pppd(8) man page), to be LOG_LOCAL2. The intent being that local2 be sent +to /var/log/ppp.log for use by plog, if you add the following line to your +/etc/syslog.conf file: + +local2.* -/var/log/ppp.log + +Not implemented: +---------------- + +Password expiration was once implemented with a direct call to a +non-exported function in libshadow, but isn't anymore. Why are +they doing such things? + +Kernel 2.0.x update: +-------------------- + +As of version 2.3.1 the kernel stuff is broken for some old 2.0.x kernels. +See the file called "kernel.fix-2.0.30-2" in this directory. + + -- Christoph Lameter , 22 July 1997 + Phil Hands + Josip Rodin , 27 November 1999. --- ppp-2.4.1.uus.orig/debian/README.STATIC-IP +++ ppp-2.4.1.uus/debian/README.STATIC-IP @@ -0,0 +1,45 @@ +Static IP addresses support with mgetty/autoPPP +----------------------------------------------- + +Debian PPP package includes a variant of ppp-2.3.0-static.diff, a patch to +ppp-2.3.0 to support using static IP addresses with Mgetty and AutoPPP. It +does not affect normal dynamic assignments. There is no need to re-compile +the kernel. + +You should update the pap-secrets file to contain the entries of those users +you want to have static IP addresses. Typical entry might look like: + +#client server secret IP addresses + jdoe * realpswd 207.69.189.15 + * * "" * + +Also, inform your static IP users to include their IP when +connecting. E.g. run `pppd 207.69.189.15:` +Or for Windows folks, check the "Specify an IP address" option and +type in the IP. + +Note: The second line is what most folks will use to authenticate +users who will be dynamically assigned their addresses by +/dev/ttyXX. This along with the login option allows users to be PAP +authenticated against the /etc/passwd or /etc/shadow. If you enter each and +every user into your pap-secrets file and do not have the last line, +(wildcards line) you MUST place a "*" at the end of each users line. +Without it, the authentication will fail. For example: + +#client server secret IP addresses + jdoe * passwd 207.69.189.15 * + +This "*" at the end allows the patches to work properly without changing +the normal process. The IP address is normally assigned via the +/etc/ppp/options.ttyXX file. The patches do not interfere with this process +at all. The only thing different is when the user tells pppd he has his own +address, pppd will allow him to use it, if he and his address are +authenticated via the pap-secrets file. The only thing to remember, is tell +your static IP users to set the "correct" IP or they will be assigned the +normal dynamic address. (And of course that's not what we want :>) If you +have any questions.... + +While I tested this as many ways as our systems would allow, no warranty +is implied. They work well for us. + +Author: Jeff Myers --- ppp-2.4.1.uus.orig/debian/dirs +++ ppp-2.4.1.uus/debian/dirs @@ -0,0 +1,9 @@ +etc/ppp/peers +etc/chatscripts +etc/ppp/ip-up.d +etc/ppp/ip-down.d +etc/pam.d +usr/bin +usr/share/man/man1 +usr/share/ppp +usr/include/net --- ppp-2.4.1.uus.orig/debian/README.win9x +++ ppp-2.4.1.uus/debian/README.win9x @@ -0,0 +1,35 @@ +Short guide on how to run a Win9x connection with PPPD to Debian Linux +---------------------------------------------------------------------- + +1. Do not mess around with the Win9x configuration. + Do not manually configure DNS, scripts etc. + Do not switch on the terminal windows. + Accept all defaults or better leave it as it was at installation. + +2. You need to have a getty program that supports automatic PPP protocol + detection, such as mgetty (versions >= 0.99). + + Note: the mgetty shipped with Debian has to be set up to enable this + behaviour - look for "AutoPPP" in the login.config configuration file. + +3. Change the "ms-dns" lines in /etc/ppp/options, and review the complete + file for things you need to do. + +4. Make sure that your /etc/ppp/pap-secrets file is set up to allow users + mentioned in system passwords database (/etc/passwd) to establish PPP + connections using their normal password. + + Note: the pap-secrets file shipped with Debian pppd is set up to enable + this by default. + +5. On the Win9x box, in Dial-Up Networking folder, create a new connection, + and enter the phone number. Prior to connecting, enter the username and + password. + +Win9x should connect to your Linux PPPD without problems and automatically +configure IP addresses, the netmask and the DNS servers. You can immediately +start Netscape, Internet Explorer or any other TCP/IP tools. + +-- Christoph Lameter , 27 September, 1996, + Josip Rodin , 27 November 1999, + Michael Beattie , 9 April 2001. --- ppp-2.4.1.uus.orig/debian/prerm +++ ppp-2.4.1.uus/debian/prerm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# If we are removing ppp we have to stop all ppp's + +if [ "$1" = remove ]; then + echo -n "Stopping all PPP connections..." + start-stop-daemon --stop --oknodo --exec /usr/sbin/pppd + echo "done." +fi + +#DEBHELPER# --- ppp-2.4.1.uus.orig/debian/control +++ ppp-2.4.1.uus/debian/control @@ -0,0 +1,39 @@ +Source: ppp +Section: base +Priority: optional +Maintainer: Michael Beattie +Build-Depends: libpam0g-dev, libpcap-dev, debhelper (>> 3.0.0) +Standards-Version: 3.5.6.0 + +Package: ppp +Section: base +Architecture: any +Depends: ${shlibs:Depends}, libpam-modules, netbase, sysvinit (>= 2.75-4), procps, makedev (>= 2.3.1-56) +Conflicts: ppp-pam, ppp-udeb +Replaces: ppp-pam, ppp-udeb +Suggests: debconf +Description: Point-to-Point Protocol (PPP) daemon. + The Point-to-Point Protocol (PPP) provides a standard way to transmit + datagrams over a serial link, as well as a standard way for the machines + at either end of the link (the "peers") to negotiate various optional + characteristics of the link. Using PPP, a serial link can be used to + transmit Internet Protocol (IP) datagrams, allowing TCP/IP connections + between the peers. + . + This package contains pppd with PAM support built-in, so `ppp-pam' + package is obsolete. + +Package: ppp-udeb +Section: debian-installer +Architecture: any +Depends: ${shlibs:Depends} +Description: Point-to-Point Protocol (PPP) daemon. + The Point-to-Point Protocol (PPP) provides a standard way to transmit + datagrams over a serial link, as well as a standard way for the machines + at either end of the link (the "peers") to negotiate various optional + characteristics of the link. Using PPP, a serial link can be used to + transmit Internet Protocol (IP) datagrams, allowing TCP/IP connections + between the peers. + . + ppp-udeb is a minimal ppp package used by the debian-installer. + --- ppp-2.4.1.uus.orig/debian/init +++ ppp-2.4.1.uus/debian/init @@ -0,0 +1,50 @@ +#!/bin/sh +# +# /etc/init.d/ppp: start or stop PPP link. +# +# If you want PPP started on boot time (most dialup systems won't need it) +# rename the /etc/ppp/no_ppp_on_boot file to /etc/ppp/ppp_on_boot, and +# follow the instructions in the comments in that file. + +test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0 +if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi + +case "$1" in + start) + echo -n "Starting up PPP link: pppd" + if [ "$RUNFILE" = "1" ]; then + /etc/ppp/ppp_on_boot + else + pppd call provider + fi + echo "." + ;; + stop) + echo -n "Shutting down PPP link: pppd" + if [ "$RUNFILE" = "1" ]; then + poff + else + poff provider + fi + echo "." + ;; + restart|force-reload) + echo -n "Restarting PPP link: pppd" + if [ "$RUNFILE" = "1" ]; then + poff + sleep 5 + /etc/ppp/ppp_on_boot + else + poff provider + sleep 5 + pppd call provider + fi + echo "." + ;; + *) + echo "Usage: /etc/init.d/ppp {start|stop|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 --- ppp-2.4.1.uus.orig/debian/options +++ ppp-2.4.1.uus/debian/options @@ -0,0 +1,348 @@ +# /etc/ppp/options +# +# Originally created by Jim Knoble +# Modified for Debian by alvar Bray +# Modified for PPP Server setup by Christoph Lameter +# +# To quickly see what options are active in this file, use this command: +# egrep -v '#|^ *$' /etc/ppp/options + +# Specify which DNS Servers the incoming Win95 or WinNT Connection should use +# Two Servers can be remotely configured +# ms-dns 192.168.1.1 +# ms-dns 192.168.1.2 + +# Specify which WINS Servers the incoming connection Win95 or WinNT should use +# ms-wins 192.168.1.50 +# ms-wins 192.168.1.51 + +# Run the executable or shell command specified after pppd has +# terminated the link. This script could, for example, issue commands +# to the modem to cause it to hang up if hardware modem control signals +# were not available. +#disconnect "chat -- \d+++\d\c OK ath0 OK" + +# async character map -- 32-bit hex; each bit is a character +# that needs to be escaped for pppd to receive it. 0x00000001 +# represents '\x01', and 0x80000000 represents '\x1f'. +asyncmap 0 + +# Require the peer to authenticate itself before allowing network +# packets to be sent or received. +# Please do not disable this setting. It is expected to be standard in +# future releases of pppd. Use the call option (see manpage) to disable +# authentication for specific peers. +auth + +# Use hardware flow control (i.e. RTS/CTS) to control the flow of data +# on the serial port. +crtscts + +# Use software flow control (i.e. XON/XOFF) to control the flow of data +# on the serial port. +#xonxoff + +# Specifies that certain characters should be escaped on transmission +# (regardless of whether the peer requests them to be escaped with its +# async control character map). The characters to be escaped are +# specified as a list of hex numbers separated by commas. Note that +# almost any character can be specified for the escape option, unlike +# the asyncmap option which only allows control characters to be +# specified. The characters which may not be escaped are those with hex +# values 0x20 - 0x3f or 0x5e. +#escape 11,13,ff + +# Don't use the modem control lines. +#local + +# Specifies that pppd should use a UUCP-style lock on the serial device +# to ensure exclusive access to the device. +lock + +# Don't show the passwords when logging the contents of PAP packets. +# This is the default. +hide-password + +# When logging the contents of PAP packets, this option causes pppd to +# show the password string in the log message. +#show-password + +# Use the modem control lines. On Ultrix, this option implies hardware +# flow control, as for the crtscts option. (This option is not fully +# implemented.) +modem + +# Set the MRU [Maximum Receive Unit] value to for negotiation. pppd +# will ask the peer to send packets of no more than bytes. The +# minimum MRU value is 128. The default MRU value is 1500. A value of +# 296 is recommended for slow links (40 bytes for TCP/IP header + 256 +# bytes of data). +#mru 542 + +# Set the interface netmask to , a 32 bit netmask in "decimal dot" +# notation (e.g. 255.255.255.0). +#netmask 255.255.255.0 + +# Disables the default behaviour when no local IP address is specified, +# which is to determine (if possible) the local IP address from the +# hostname. With this option, the peer will have to supply the local IP +# address during IPCP negotiation (unless it specified explicitly on the +# command line or in an options file). +#noipdefault + +# Enables the "passive" option in the LCP. With this option, pppd will +# attempt to initiate a connection; if no reply is received from the +# peer, pppd will then just wait passively for a valid LCP packet from +# the peer (instead of exiting, as it does without this option). +#passive + +# With this option, pppd will not transmit LCP packets to initiate a +# connection until a valid LCP packet is received from the peer (as for +# the "passive" option with old versions of pppd). +#silent + +# Don't request or allow negotiation of any options for LCP and IPCP +# (use default values). +#-all + +# Disable Address/Control compression negotiation (use default, i.e. +# address/control field disabled). +#-ac + +# Disable asyncmap negotiation (use the default asyncmap, i.e. escape +# all control characters). +#-am + +# Don't fork to become a background process (otherwise pppd will do so +# if a serial device is specified). +#-detach + +# Disable IP address negotiation (with this option, the remote IP +# address must be specified with an option on the command line or in +# an options file). +#-ip + +# Disable IPCP negotiation and IP communication. This option should +# only be required if the peer is buggy and gets confused by requests +# from pppd for IPCP negotiation. +#noip + +# Disable magic number negotiation. With this option, pppd cannot +# detect a looped-back line. +#-mn + +# Disable MRU [Maximum Receive Unit] negotiation (use default, i.e. +# 1500). +#-mru + +# Disable protocol field compression negotiation (use default, i.e. +# protocol field compression disabled). +#-pc + +# Require the peer to authenticate itself using PAP. +#+pap + +# Don't agree to authenticate using PAP. +#-pap + +# Require the peer to authenticate itself using CHAP [Cryptographic +# Handshake Authentication Protocol] authentication. +#+chap + +# Don't agree to authenticate using CHAP. +#-chap + +# Disable negotiation of Van Jacobson style IP header compression (use +# default, i.e. no compression). +#-vj + +# Increase debugging level (same as -d). If this option is given, pppd +# will log the contents of all control packets sent or received in a +# readable form. The packets are logged through syslog with facility +# daemon and level debug. This information can be directed to a file by +# setting up /etc/syslog.conf appropriately (see syslog.conf(5)). (If +# pppd is compiled with extra debugging enabled, it will log messages +# using facility local2 instead of daemon). +#debug + +# Append the domain name to the local host name for authentication +# purposes. For example, if gethostname() returns the name porsche, +# but the fully qualified domain name is porsche.Quotron.COM, you would +# use the domain option to set the domain name to Quotron.COM. +#domain + +# Enable debugging code in the kernel-level PPP driver. The argument n +# is a number which is the sum of the following values: 1 to enable +# general debug messages, 2 to request that the contents of received +# packets be printed, and 4 to request that the contents of transmitted +# packets be printed. +#kdebug n + +# Set the MTU [Maximum Transmit Unit] value to . Unless the peer +# requests a smaller value via MRU negotiation, pppd will request that +# the kernel networking code send data packets of no more than n bytes +# through the PPP network interface. +#mtu + +# Set the name of the local system for authentication purposes to . +# This is a privileged option. With this option, pppd will use lines in the +# secrets files which have as the second field when looking for a +# secret to use in authenticating the peer. In addition, unless overridden +# with the user option, will be used as the name to send to the peer +# when authenticating the local system to the peer. (Note that pppd does +# not append the domain name to .) +#name + +# Enforce the use of the hostname as the name of the local system for +# authentication purposes (overrides the name option). +#usehostname + +# Set the assumed name of the remote system for authentication purposes +# to . +#remotename + +# Add an entry to this system's ARP [Address Resolution Protocol] +# table with the IP address of the peer and the Ethernet address of this +# system. +proxyarp + +# Use the system password database for authenticating the peer using +# PAP. Note: mgetty already provides this option. If this is specified +# then dialin from users using a script under Linux to fire up ppp wont work. +# login + +# If this option is given, pppd will send an LCP echo-request frame to the +# peer every n seconds. Normally the peer should respond to the echo-request +# by sending an echo-reply. This option can be used with the +# lcp-echo-failure option to detect that the peer is no longer connected. +lcp-echo-interval 30 + +# If this option is given, pppd will presume the peer to be dead if n +# LCP echo-requests are sent without receiving a valid LCP echo-reply. +# If this happens, pppd will terminate the connection. Use of this +# option requires a non-zero value for the lcp-echo-interval parameter. +# This option can be used to enable pppd to terminate after the physical +# connection has been broken (e.g., the modem has hung up) in +# situations where no hardware modem control lines are available. +lcp-echo-failure 4 + +# Set the LCP restart interval (retransmission timeout) to seconds +# (default 3). +#lcp-restart + +# Set the maximum number of LCP terminate-request transmissions to +# (default 3). +#lcp-max-terminate + +# Set the maximum number of LCP configure-request transmissions to +# (default 10). +#lcp-max-configure + +# Set the maximum number of LCP configure-NAKs returned before starting +# to send configure-Rejects instead to (default 10). +#lcp-max-failure + +# Set the IPCP restart interval (retransmission timeout) to +# seconds (default 3). +#ipcp-restart + +# Set the maximum number of IPCP terminate-request transmissions to +# (default 3). +#ipcp-max-terminate + +# Set the maximum number of IPCP configure-request transmissions to +# (default 10). +#ipcp-max-configure + +# Set the maximum number of IPCP configure-NAKs returned before starting +# to send configure-Rejects instead to (default 10). +#ipcp-max-failure + +# Set the PAP restart interval (retransmission timeout) to seconds +# (default 3). +#pap-restart + +# Set the maximum number of PAP authenticate-request transmissions to +# (default 10). +#pap-max-authreq + +# Set the maximum time that pppd will wait for the peer to authenticate +# itself with PAP to seconds (0 means no limit). +#pap-timeout + +# Set the CHAP restart interval (retransmission timeout for +# challenges) to seconds (default 3). +#chap-restart + +# Set the maximum number of CHAP challenge transmissions to +# (default 10). +#chap-max-challenge + +# If this option is given, pppd will rechallenge the peer every +# seconds. +#chap-interval + +# With this option, pppd will accept the peer's idea of our local IP +# address, even if the local IP address was specified in an option. +#ipcp-accept-local + +# With this option, pppd will accept the peer's idea of its (remote) IP +# address, even if the remote IP address was specified in an option. +#ipcp-accept-remote + +# Disable the IPXCP and IPX protocols. +# To let pppd pass IPX packets comment this out --- you'll probably also +# want to install ipxripd, and have the Internal IPX Network option enabled +# in your kernel. /usr/doc/HOWTO/IPX-HOWTO.gz contains more info. +noipx + +# Exit once a connection has been made and terminated. This is the default, +# unless the `persist' or `demand' option has been specified. +#nopersist + +# Do not exit after a connection is terminated; instead try to reopen +# the connection. +#persist + +# Terminate after n consecutive failed connection attempts. +# A value of 0 means no limit. The default value is 10. +#maxfail + +# Initiate the link only on demand, i.e. when data traffic is present. +# With this option, the remote IP address must be specified by the user on +# the command line or in an options file. Pppd will initially configure +# the interface and enable it for IP traffic without connecting to the peer. +# When traffic is available, pppd will connect to the peer and perform +# negotiation, authentication, etc. When this is completed, pppd will +# commence passing data packets (i.e., IP packets) across the link. +#demand + +# Specifies that pppd should disconnect if the link is idle for seconds. +# The link is idle when no data packets (i.e. IP packets) are being sent or +# received. Note: it is not advisable to use this option with the persist +# option without the demand option. If the active-filter option is given, +# data packets which are rejected by the specified activity filter also +# count as the link being idle. +#idle + +# Specifies how many seconds to wait before re-initiating the link after +# it terminates. This option only has any effect if the persist or demand +# option is used. The holdoff period is not applied if the link was +# terminated because it was idle. +#holdoff + +# Wait for up n milliseconds after the connect script finishes for a valid +# PPP packet from the peer. At the end of this time, or when a valid PPP +# packet is received from the peer, pppd will commence negotiation by +# sending its first LCP packet. The default value is 1000 (1 second). +# This wait period only applies if the connect or pty option is used. +#connect-delay + +# Packet filtering: for more information, see pppd(8) +# Any packets matching the filter expression will be interpreted as link +# activity, and will cause a "demand" connection to be activated, and reset +# the idle connection timer. (idle option) +# The filter expression is akin to that of tcpdump(1) +#active-filter + +# ------ --- ppp-2.4.1.uus.orig/debian/pon.1 +++ ppp-2.4.1.uus/debian/pon.1 @@ -0,0 +1,120 @@ +.\" This manual is published under the GPL. +.\" All guidelines specified in the GPL apply here. +.\" To get an ascii file: +.\" groff -man -Tascii pon.1 > pon.txt +.\" +.TH PON 1 "July 2000" "Debian Project" "Debian PPPD" +.SH NAME +pon, poff, plog \- starts up, shuts down or lists the log of PPP connections +.SH SYNOPSIS +.B pon +[ isp-name [ options ] ] +.br +.B poff +[ -r ] [ -d ] [ -c ] [ -a ] [ -h ] [ isp-name ] +.br +.B plog +[ arguments ] +.SH DESCRIPTION +This manual page describes the \fBpon\fP, \fBplog\fP and \fBpoff\fP +scripts, which allow users to control PPP connections. +.. +.SS pon +\fBpon\fP, invoked without arguments, runs the \fI/etc/ppp/ppp_on_boot\fP +file, if it exists and is executable. Otherwise, a PPP connection will be +started using configuration from \fI/etc/ppp/peers/provider\fP. +This is the default behaviour unless an \fBisp-name\fP argument is given. +.PP +For instance, to use ISP configuration "myisp" run: +.IP +pon myisp +.PP +\fBpon\fP will then use the options file \fI/etc/ppp/peers/myisp\fP. +You can pass additional \fBoptions\fP after the ISP name, too. +\fBpon\fP can be used to run multiple, simultaneous PPP connections. +.. +.SS poff +\fBpoff\fP closes a PPP connection. If more than one PPP connection exists, +the one named in the argument to \fBpoff\fP will be killed, e.g. +.IP +poff myprovider2 +.PP +will terminate the connection to myprovider2, and leave the PPP connections +to e.g. "myprovider1" or "myprovider3" up and running. +.PP +\fBpoff\fP takes the following command line options: +.RS +.TP +.B "\-r" +causes the connection to be redialed after it is dropped. +.TP +.B "\-d" +toggles the state of pppd's debug option. +.TP +.B "\-c" +causes +.BR pppd (8) +to renegotiate compression. +.TP +.B "\-a" +stops all running ppp connections. If the argument \fBisp-name\fP +is given it will be ignored. +.TP +.B "\-h" +displays help information. +.TP +.B "\-v" +prints the version and exits. +.PP +If no argument is given, \fBpoff\fP will stop or signal pppd if and only +if there is exactly one running. If more than one connection is active, +it will exit with an error code of 1. +.. +.SS plog +\fBplog\fP shows you the last few lines of \fI/var/log/ppp.log\fP. If that +file doesn't exist, it shows you the last few lines of your +\fI/var/log/syslog\fP file, but excluding the lines not generated by pppd. +This script makes use of the +.BR tail (1) +command, so arguments that can be passed to +.BR tail (1) +can also be passed to \fBplog\fP. +.PP +Note: the \fBplog\fP script can only be used by root or another system +administrator in group "adm", due to security reasons. Also, to have all +pppd-generated information in one logfile, that plog can show, you need the +following line in your \fI/etc/syslog.conf\fP file: +.PP +local2.* -/var/log/ppp.log +.RE +.SH FILES +.TP +.I /etc/ppp/options +PPPd system options file. +.TP +.I /etc/ppp/pap-secrets +System PAP passwords file. +.TP +.I /etc/ppp/chap-secrets +System CHAP passwords file. +.TP +.I /etc/ppp/peers/ +Directory holding the peer options files. The default file is called +\fIprovider\fP. +.TP +.I /etc/chatscripts/provider +The chat script invoked from the default \fI/etc/ppp/peers/provider\fP. +.TP +.I /var/log/ppp.log +The default PPP log file. +.SH AUTHORS +The p-commands were written by Christoph Lameter . +Updated and revised by Philip Hands . +.br +This manual was written by Othmar Pasteka . Modified +by Rob Levin , with some extensions taken from +the old p-commands manual written by John Hasler . +.SH "SEE ALSO" +.BR pppd (8), +.BR chat (8), +.BR tail (1). --- ppp-2.4.1.uus.orig/debian/postrm +++ ppp-2.4.1.uus/debian/postrm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +if [ "$1" = "purge" ]; then + rm -rf /etc/ppp /etc/chatscripts +fi + +#DEBHELPER# --- ppp-2.4.1.uus.orig/debian/copyright +++ ppp-2.4.1.uus/debian/copyright @@ -0,0 +1,247 @@ +This is the Debian GNU/Linux prepackaged version of pppd. + +This package was previously maintained by Ian Murdock , +Alvar Bray , Christoph Lameter , and +Philip Hands . + +Today it is maintained by Michael Beattie . + +Original sources were obtained from: + ftp://ftp.linuxcare.com.au/pub/ppp/ + +Previous versions obtained from: + ftp://cs.anu.edu.au/pub/software/ppp/ + +The options file was originally obtained from: + ftp://sunsite.unc.edu/pub/Linux/system/Network/serial/pppopt.tgz +It was later heavily modified by various people, with additions from +different sources. + +All of the code can be freely used and redistributed. The individual +source files each have their own copyright and permission notice; some +have a BSD-style notice and some are under the GPL. + +The following files (and files related to them), used in building this pppd: + auth.c fsm.c ipcp.c ipxcp.c lcp.c magic.c main.c options.c sys-linux.c upap.c +are covered by this copyright and license: + + * Copyright (c) 1989 Carnegie Mellon University. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by Carnegie Mellon University. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED `AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The file auth.c is covered by the above, and the following license +(along with ccp.c chap.c demand.c and utils.c files): + + * Copyright (c) 1993 The Australian National University. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the Australian National University. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED `AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The file chap.c also is covered by this copyright and license: + + * Copyright (c) 1991 Gregory M. Christy. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by Gregory M. Christy. The name of the author may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED `AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The file md5.c (and related) is covered by this copyright and license: + + *********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + *********************************************************************** + +The file cbcp.c (and related) is covered by the following copyright and +license: + + * Copyright (c) 1995 Pedro Roque Marques + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by Pedro Roque Marques. The name of the author may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The file chap_ms.c (and related) is covered by the following copyright and +license: + + * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. + * http://www.strataware.com/ + * + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by Eric Rosenquist. The name of the author may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The files vjcompress.h and slcompress.h are covered by this: + + * Copyright (c) 1989 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED `AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The `chat' program is in the public domain. + +The pppdump program is Copyright (C) 1999 Paul Mackerras. All rights +reserved. Licensed under the GNU GPL version 2 or later. + +pppdump/zlib.c is: + + Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +pppdump/deflate.c is: + + * Copyright (c) 1994 The Australian National University. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation is hereby granted, provided that the above copyright + * notice appears in all copies. This software is provided without any + * warranty, express or implied. The Australian National University + * makes no representations about the suitability of this software for + * any purpose. + * + * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY + * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF + * THE AUSTRALIAN NATIONAL UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO + * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, + * OR MODIFICATIONS. + +pppdump/bsd-comp.c is: + + * Copyright (c) 1985, 1986 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * James A. Woods, derived from original work by Spencer Thomas + * and Joseph Orost. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + +[don't you just love legalese] --- ppp-2.4.1.uus.orig/debian/postinst +++ ppp-2.4.1.uus/debian/postinst @@ -0,0 +1,106 @@ +#!/bin/sh -e + +action="$1" + +# fixup after ppp-connect removed (unless this is an abort-* action) +expr "${action}" : abort- >/dev/null || { + if [ -f /etc/ppp/ppp-connect ] ; then + echo "The file /etc/ppp/ppp-connect is no longer part of the ppp" + echo -n "package, removing..." + rm /etc/ppp/ppp-connect + fi +} + +# fixup after old update-rc.d +if [ -f /etc/rc2.d/K20ppp ] ; then + echo Fixing up start/stop scripts + rm -f /etc/rc2.d/K20ppp + rm -f /etc/rc3.d/K20ppp + rm -f /etc/rc4.d/K20ppp + rm -f /etc/rc5.d/K20ppp +fi + +# get rid of old /etc/cron.daily/ppp +test -f /etc/cron.daily/ppp && rm -f /etc/cron.daily/ppp + +# install /etc/ppp/pap-secrets and /etc/ppp/chap-secrets from templates, +# if necessary +if [ ! -f /etc/ppp/chap-secrets ];then + install -m 600 /usr/share/ppp/chap-secrets /etc/ppp +fi +if [ ! -f /etc/ppp/pap-secrets ];then + install -m 600 /usr/share/ppp/pap-secrets /etc/ppp +fi + +# install template provider files. +if [ ! -f /etc/ppp/peers/provider ];then + install -g dip -m 640 /usr/share/ppp/provider.peer \ + /etc/ppp/peers/provider +fi +if [ ! -f /etc/chatscripts/provider ];then + install -g dip -m 640 /usr/share/ppp/provider.chatscript \ + /etc/chatscripts/provider +fi + + +# setup hostname in /etc/ppp/pap-secrets and /etc/ppp/options.ttyXX +HOST="`hostname`" +for i in /etc/ppp/pap-secrets /etc/ppp/options.ttyXX; do + if grep -q hostname $i; then + tmp=$i.tmp-$$ + cp $i $tmp + sed -e "s/hostname/$HOST/g" <$tmp >$i + rm $tmp + fi +done + +if [ -f /etc/ppp.options_out -a -f /etc/ppp.chatscript ]; then + echo "Converting old dialup setup to new setup" + mv /etc/ppp.chatscript /etc/chatscripts/provider + X=`cat /etc/ppp.options_out` + cat >/etc/ppp/peers/provider <<-!EOF! + # The chatscript (be sure to edit that file too) + connect "/usr/sbin/chat -v -f /etc/chatscripts/provider" + $X +!EOF! + rm /etc/ppp.options_out + chmod 640 /etc/chatscripts/provider /etc/ppp/peers/provider + chgrp dip /etc/chatscripts/provider /etc/ppp/peers/provider +fi + +if [ -f /var/log/ppp.log ]; then + chown root.adm /var/log/ppp.log + chmod 640 /var/log/ppp.log +fi +if [ -f /var/log/ppp-connect-errors ]; then + chown root.adm /var/log/ppp-connect-errors + chmod 640 /var/log/ppp-connect-errors +fi + +# lets make the /dev/ppp node if we dont have devfs +if [ ! -c /dev/ppp -a ! -c /dev/.devfsd ]; then + cd /dev && /sbin/MAKEDEV ppp + # braindead makedev - group dip, not dialout. + chgrp dip /dev/ppp +fi + +# fix the perms on all sensitive files. +# FIXME - this could be bad :) (if you dont see why, you're a moron) +if [ -e /etc/ppp/pap-secrets ]; then + chown root.dip /etc/ppp/pap-secrets + chmod 0600 /etc/ppp/pap-secrets +fi +if [ -e /etc/ppp/chap-secrets ]; then + chown root.dip /etc/ppp/chap-secrets + chmod 0600 /etc/ppp/chap-secrets +fi +if [ -e /etc/ppp/peers/provider ]; then + chown root.dip /etc/ppp/peers/provider + chmod 0640 /etc/ppp/peers/provider +fi +if [ -e /etc/chatscripts/provider ]; then + chown root.dip /etc/chatscripts/provider + chmod 0640 /etc/chatscripts/provider +fi + +#DEBHELPER# --- ppp-2.4.1.uus.orig/debian/preinst +++ ppp-2.4.1.uus/debian/preinst @@ -0,0 +1,26 @@ +#!/bin/sh -e + +# Remove the diversions on /usr/sbin/pppd caused by old ppp-pam package. + +if dpkg-divert --list /usr/sbin/pppd | grep -q "diversion of /usr/sbin/pppd to /usr/sbin/pppd.nopam by ppp-pam"; then + dpkg-divert --package ppp-pam --remove \ + --divert /usr/sbin/pppd.nopam /usr/sbin/pppd +fi + +if dpkg-divert --list /usr/sbin/pppd | grep -q "diversion of /usr/sbin/pppd to /usr/sbin/pppd.ppp-pam by ppp-pam"; then + dpkg-divert --package ppp-pam --remove --rename \ + --divert /usr/sbin/pppd.ppp-pam /usr/sbin/pppd +fi + +# Remove the old diverted files. +if [ -x /usr/sbin/pppd ]; then + rm -f /usr/sbin/pppd.nopam /usr/sbin/pppd.ppp-pam +fi + +# Remove wrong suidmanager entries caused by diverted files. +if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then + suidunregister -s ppp /usr/sbin/pppd.nopam + suidunregister -s ppp /usr/sbin/pppd.ppp-pam +fi + +#DEBHELPER# --- ppp-2.4.1.uus.orig/debian/poff +++ ppp-2.4.1.uus/debian/poff @@ -0,0 +1,104 @@ +#!/bin/sh + +# $Id: poff,v 1.8 1999/08/28 16:34:51 phil Exp $ +# Written by John Hasler and based on work +# by Phil Hands . Distributed under the GNU GPL + +if [ -x /usr/bin/kill ]; then + KILL="/usr/bin/kill" +else + KILL="/bin/kill" +fi +SIG=TERM +DONE="stopped" +MODE="" + +usage () +{ + cat < +To: clameter@miriam.fuller.edu +Cc: linux-kernel@vger.rutgers.edu, davem@jenolan.rutgers.edu, + longyear@netcom.com, callahan@maths.ox.ac.uk +Subject: Re: ppp 2.3.1 patch for Linux 2.1.4x+ + + +This reminds me, I had to modify ppp.c from ppp-2.3.1 to make it work +with kernel 2.0.31-pre2. Here is the patch to the ppp.c distributed +with 2.3.1. I'm not sure if any of this should be in 2.0.31 or not. + +Larry + + +--- ppp.c Sun Jul 13 20:50:50 1997 ++++ /usr/src/linux/drivers/net/ppp.c Mon Jul 21 10:59:54 1997 +@@ -455,7 +455,7 @@ + dev->rebuild_header = ppp_dev_rebuild; + #endif + +- dev->hard_header_len = PPP_HARD_HDR_LEN; ++ dev->hard_header_len = PPP_HDRLEN; + + /* device INFO */ + dev->mtu = PPP_MTU; +@@ -2196,6 +2196,7 @@ + struct ppp *ppp = tty2ppp (tty); + __u8 *new_data; + int proto; ++ int error; + + /* + * Verify the pointers. +@@ -2231,7 +2232,8 @@ + /* + * Retrieve the user's buffer + */ +- if (copy_from_user (new_data, data, count)) { ++ COPY_FROM_USER (error, new_data, data, count); ++ if (error != 0) { + kfree (new_data); + return -EFAULT; + } --- ppp-2.4.1.uus.orig/debian/provider.peer +++ ppp-2.4.1.uus/debian/provider.peer @@ -0,0 +1,21 @@ +# These are the options to dial out to your default service provider. +# Please customize them correctly. Only the "provider" file will be +# handled by poff and pon (unless with extra command line arguments). + +# You usually need this if there is no PAP authentication +noauth + +# The chat script (be sure to edit that file, too!) +connect "/usr/sbin/chat -v -f /etc/chatscripts/provider" + +# Set up routing to go through this PPP link +defaultroute + +# Default modem (you better replace this with /dev/ttySx!) +/dev/modem + +# Speed +38400 + +# Keep modem up even if connection fails +persist --- ppp-2.4.1.uus.orig/debian/ip-down +++ ppp-2.4.1.uus/debian/ip-down @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $Id: ip-down,v 1.2 1998/02/10 21:21:55 phil Exp $ +# +# This script is run by the pppd _after_ the link is brought down. +# It uses run-parts to run scripts in /etc/ppp/ip-down.d, so to delete +# routes, unset IP addresses etc. you should create script(s) there. +# +# Be aware that other packages may include /etc/ppp/ip-down.d scripts (named +# after that package), so choose local script names with that in mind. +# +# This script is called with the following arguments: +# Arg Name Example +# $1 Interface name ppp0 +# $2 The tty ttyS1 +# $3 The link speed 38400 +# $4 Local IP number 12.34.56.78 +# $5 Peer IP number 12.34.56.99 +# $6 Optional ``ipparam'' value foo + +# The environment is cleared before executing this script +# so the path must be reset +PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin +export PATH +# These variables are for the use of the scripts run by run-parts +PPP_IFACE="$1" +PPP_TTY="$2" +PPP_SPEED="$3" +PPP_LOCAL="$4" +PPP_REMOTE="$5" +PPP_IPPARAM="$6" +export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM + +# as an additional convenience, $PPP_TTYNAME is set to the tty name, +# stripped of /dev/ (if present) for easier matching. +PPP_TTYNAME=`/usr/bin/basename "$2"` +export PPP_TTYNAME + +# Main Script starts here + +run-parts /etc/ppp/ip-down.d + +# last line --- ppp-2.4.1.uus.orig/debian/ip-up +++ ppp-2.4.1.uus/debian/ip-up @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $Id: ip-up,v 1.2 1998/02/10 21:25:34 phil Exp $ +# +# This script is run by the pppd after the link is established. +# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes, +# set IP address, run the mailq etc. you should create script(s) there. +# +# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named +# after that package), so choose local script names with that in mind. +# +# This script is called with the following arguments: +# Arg Name Example +# $1 Interface name ppp0 +# $2 The tty ttyS1 +# $3 The link speed 38400 +# $4 Local IP number 12.34.56.78 +# $5 Peer IP number 12.34.56.99 +# $6 Optional ``ipparam'' value foo + +# The environment is cleared before executing this script +# so the path must be reset +PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin +export PATH +# These variables are for the use of the scripts run by run-parts +PPP_IFACE="$1" +PPP_TTY="$2" +PPP_SPEED="$3" +PPP_LOCAL="$4" +PPP_REMOTE="$5" +PPP_IPPARAM="$6" +export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM + + +# as an additional convenience, $PPP_TTYNAME is set to the tty name, +# stripped of /dev/ (if present) for easier matching. +PPP_TTYNAME=`/usr/bin/basename "$2"` +export PPP_TTYNAME + +# Main Script starts here + +run-parts /etc/ppp/ip-up.d + +# last line --- ppp-2.4.1.uus.orig/debian/pap-secrets +++ ppp-2.4.1.uus/debian/pap-secrets @@ -0,0 +1,41 @@ +# +# /etc/ppp/pap-secrets +# +# This is a pap-secrets file to be used with the AUTO_PPP function of +# mgetty. mgetty-0.99 is preconfigured to startup pppd with the login option +# which will cause pppd to consult /etc/passwd (and /etc/shadow in turn) +# after a user has passed this file. Don't be disturbed therfore by the fact +# that this file defines logins with any password for users. /etc/passwd +# (again, /etc/shadow, too) will catch passwd mismatches. +# +# This file should block ALL users that should not be able to do AUTO_PPP. +# AUTO_PPP bypasses the usual login program so its necessary to list all +# system userids with regular passwords here. +# +# ATTENTION: The definitions here can allow users to login without a +# password if you don't use the login option of pppd! The mgetty Debian +# package already provides this option; make sure you don't change that. + +# INBOUND connections + +# Every regular user can use PPP and has to use passwords from /etc/passwd +* hostname "" * + +# UserIDs that cannot use PPP at all. Check your /etc/passwd and add any +# other accounts that should not be able to use pppd! +guest hostname "*" - +master hostname "*" - +root hostname "*" - +support hostname "*" - +stats hostname "*" - + +# OUTBOUND connections + +# Here you should add your userid password to connect to your providers via +# PAP. The * means that the password is to be used for ANY host you connect +# to. Thus you do not have to worry about the foreign machine name. Just +# replace password with your password. +# If you have different providers with different passwords then you better +# remove the following line. + +hostname * password --- ppp-2.4.1.uus.orig/debian/options.ttyXX +++ ppp-2.4.1.uus/debian/options.ttyXX @@ -0,0 +1,22 @@ +# If you need to set up multiple serial lines differently, then copy this +# file to options. for each with a modem on it. +# +# Example: +# options.ttyS1 for the second serial port (a.k.a. COM2) +# +# Edit the following line so that the first IP address mentioned is the is +# the IP address or name of your host, while the second is the IP address +# or name of the remote machine. + +hostname:remotepeername +# 192.168.0.1:192.168.0.2 + +# You may also put additional settings in each file, just like in the +# general options file. For example: +# +# noauth +# debug +# defaultroute +# mtu 296 +# +# Read pppd(8) for more information. --- ppp-2.4.1.uus.orig/debian/provider.chatscript +++ ppp-2.4.1.uus/debian/provider.chatscript @@ -0,0 +1,19 @@ +# This is the chat script used to dial out to your default service provider. +# Please customize the entries enclosed in parenthesis to match your setup. +# Only the "provider" file will be handled by poff and pon (unless with +# extra command line arguments). +# +# Remember to edit /etc/ppp/peers/provider accordingly. +# +# ATZW2 as a default init string +# - On all hayes compatible modems, W2 will correctly report the connect +# speed. +# +ABORT BUSY +ABORT "NO CARRIER" +ABORT VOICE +ABORT "NO DIALTONE" +"" ATZW2 +OK ATDT +ogin +word \q --- ppp-2.4.1.uus.orig/debian/pon +++ ppp-2.4.1.uus/debian/pon @@ -0,0 +1,38 @@ +#!/bin/sh + +case "$1" in + -*) echo " +Usage: pon [provider] [arguments] + +If pon is invoked without arguments, /etc/ppp/ppp_on_boot file will be +run, presuming it exists and is executable. Otherwise, a PPP connection +will be started using settings from /etc/ppp/peers/provider. +If you specify one argument, a PPP connection will be started using +settings from the appropriate file in the /etc/ppp/peers/ directory, and +any additional arguments supplied will be passed as extra arguments to +pppd. +" + exit 0 + ;; +esac + +if [ -z "$1" -a -x /etc/ppp/ppp_on_boot ]; then + exec /etc/ppp/ppp_on_boot +fi + +if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then + echo " +Please configure /etc/ppp/peers/provider or use a command line argument to +use another file in /etc/ppp/peers/ directory. +" + exit 1 +fi + +if [ "$1" -a ! -f "/etc/ppp/peers/$1" ]; then + echo " +The file /etc/ppp/peers/$1 does not exist. +" + exit 1 +fi + +exec /usr/sbin/pppd call ${@:-provider} --- ppp-2.4.1.uus.orig/debian/no_ppp_on_boot +++ ppp-2.4.1.uus/debian/no_ppp_on_boot @@ -0,0 +1,21 @@ +###!/bin/sh +# +# Rename this file to ppp_on_boot and pppd will be fired up as +# soon as the system comes up, connecting to `provider'. +# +# If you also make this file executable, and replace the first line +# with just "#!/bin/sh", the commands below will be executed instead. +# + +# The location of the ppp daemon itself (shouldn't need to be changed) +PPPD=/usr/sbin/pppd + +# The default provider to connect to +$PPPD call provider + +# Additional connections, which would just use settings from +# /etc/ppp/options. +#$PPPD ttyS0 +#$PPPD ttyS1 +#$PPPD ttyS2 +#$PPPD ttyS3 --- ppp-2.4.1.uus.orig/debian/plog +++ ppp-2.4.1.uus/debian/plog @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -s /var/log/ppp.log ]; then + exec tail "$@" /var/log/ppp.log +else + exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\[' +fi --- ppp-2.4.1.uus.orig/debian/modules +++ ppp-2.4.1.uus/debian/modules @@ -0,0 +1,7 @@ +alias /dev/ppp ppp_generic +alias char-major-108 ppp_generic +alias tty-ldisc-3 ppp_async +alias tty-ldisc-14 ppp_synctty +alias ppp-compress-21 bsd_comp +alias ppp-compress-24 ppp_deflate +alias ppp-compress-26 ppp_deflate --- ppp-2.4.1.uus.orig/README.CBCP.en +++ ppp-2.4.1.uus/README.CBCP.en @@ -0,0 +1,165 @@ +First of all sorry for my English! +My mother tongue is Hungarian. +If anything isn't clear for you write me! +I think you find grammar mistakes in this file. If you understand my think, +please write me the correct sentences. +I am not a good translator! :-) Sorry. + +1. Compiling +- Default IPX_CHANGE and CBCP_SUPPORT define is set. +- In older kernel versions / kernel < 2.2.0 / #define PPP_CBCP line is missing + from pppdefs.h file which is in the include directory, so cbcp.c won't be + compiled succesfully. The reason is: pppdefs.h file is situated in the 'net' + directory of ppp package but the compiler will use the kernel header file with + same name in which the #define PPP_CBCP line can't be found. + +2. Install: +- from rpm: + Before install the rpm, please remove the original ppp package, because this + CBCP isn't an official part of the ppp (yet). That's why there isn't newer + version number. We always patch the official ppp, if we have enough time. + You shouldn't try upgrade with rpm -U. + If you try it before uninstall original ppp package, you will get "conflict" + with original package. So use --force parameter or rpm -e ppp-original.rpm + remove ppp package. + + WARNING !!! + Don't forget to backup your files (eg. options) from /etc/ppp directory! + If you do, you must reinvent the parameters of your PPP connection. + + After you installed our package by rpm -ih ppp-x.y.z-cbcpx.rpm, please check + /usr/doc/ppp-x.y.z directory because there are some files which are very + important for CBCP, like callback-server, -client and -users files. + Callback-users file is situated in the sample subdirectory, others are in + the scripts subdir. + Copy them to /etc/ppp directory! I don't know why this is the default place + for important files eg. ip-up, auth-up, options etc. But this is the RH + standard. :-( + I put some options file in the sample directory. I hope these are very usefull + examples what I use in my place. These files: options.autoppp for mgetty + /AutoPPP/ function and options.ttyS1.ipx for different IPX network numbers. + ttyS1 is the 2nd. serial interface. Don't forget remove .ipx from the end + of the filename. + +- from source tgz package: + - use the 'make insatall' command. After that you can find three more files + in the /etc/ppp directory: + - /etc/ppp/callback-client - script which is waiting for callback by server + - /etc/ppp/callback-server - script which is calling back the client + - /etc/ppp/callback-users - user - callback mode relation. ( no callback, + callback fix place and callback to user given number) + - If the modem needs any special initialization to do the callback procedure + (initiate or receive) then you have to edit the callback-client and + callback-server scripts. + The first parameter of the script is always a timer value in seconds what was + given by CBCP as a waiting period before the callback starts. The second + parameter of the server script is the telephone number what we need call to + reach the client who initiated the connection. + +3. Usage: +- pppd asks the callback. Then the parameter is the telephone number on which + the server can call back us. The number will only be used in that situation if + the remote end is able to accept our callback asking and it asks the callback + number. /In Admin defined situation - of cource - the number won't be used + although callback happened./ You can use not only numbers but any other modem + commands like AT commands. For example: P01WT1234567. +- pppd doing callback. Then we have to give 'server' text after the 'callback'. + There are two possibilities which depends on we want authentication or not: + - if we don't want auth and we want callback then the pppd always uses the + number which was given by user who wants to be called back. + - if there is auth the program uses /etc/ppp/callback-user file to check + whether the given user has to callback or hasn't and what is the number. + Default who isn't in the list the server won't callback. + Structure of the file: + + username option + + In the username string the * and ? wildcard characters can be used but the + most strict hit will be used! + Option: + - if it is missing or * then the phone number is user definied + - if - no callback + - any other situations mean Admin definied and the other value is the number + what we must call back. + + Examples: + * * + pro* - + pro12 4567890 + + Default everyone will be called back /* user, * option/, but the users whose + ID starts 'pro' won't /pro* user, - option/, except 'pro12' user who will be + called back at 4567890. + The program can interpret correctly the 'us*deve??01' expression, too. :-) + (Be carefull! This part of the program doesn't work correctly. Check before + use.) + +4. Errors and its repair: +- if the pppd was started by the 'callback server' parameters then we can get + the next messages in the log and the pppd exit: + Jul 22 08:41:36 haziko pppd[2886]: Callback with + Jul 22 08:41:36 haziko pppd[2886]: tcgetattr: Input/output error(5) + Jul 22 08:41:37 haziko pppd[2886]: Exit. + This malfunction always happen if the modem of the server side drops the + connection when ppp hasn't exited yet from the communication loop. Lack of + something better in this situation the port closing and reopening is the + medicine. / Corrected 98.07.21. - main.c. / + + If the CBCP don't get the indirect acknowledge for CBCP_ACK message, + it is susceptible to send more, the callback_in_progress variable + will always be put back. This variable is used to notify that after + exiting from the communication loop a callback will be executed. + Another problem: if the CBCP hadn't got any ack then closed the + connection after a while but at this time CBCP went back the callback + loop. / Corrected 98.07.25 - cbcp.c. / + + Problem has arisen that the user which was taken from the callback-user file + hasn't found by the system. For this problem checking the 'debug' command + writes the searched user's name, the most similar to and found item, precision + of hit and the option which is belonged to it in the log file. + +Notices about NT4 RAS (Remote Access Server) with CBCP: + Please give me some time! + In this situation Linux is a CBCP client with "callback tel_num" parameter + and NT4 RAS is the CBCP server. + The most important: use "receive-all" option and m$-chap extension, plus our + CBCP patch, of course! :-) + Don't forget chap-secrets, too. + I will put here my first test options file to connect NT RAS with CBCP. + This was a very brief How-To for NT RAS. + If you found next situation, please use "receive-all" parameter: + - In the 2nd part of the callback process when NT RAS initiates the dial, Linux + gets a lot of "Bad FCS" packets and after 10th LCP reguests, connection will + be failed. + NT receive the LCP requests from Linux correctly, according to ppp.log. + +Bugs: + - When NT client don't want callback but Linux CBCP server offer it, connection + will be dropped, silently. I don't know why. Logs are under processing. + - When NT client doesn't want callback from Linux CBCP server, Linux sets + delay to 0 instead of 5s. This is not too serious, because 0s means about + 4-6s delay between drop the line at the end of 1st phase and starts to + dial-out at the start of 2nd phase. We are working on this bug. + - This CBCP patch works with W2K in client mode. I have made a small test with + RC2 English. + Please don't use any M$ specific security options like Kerberos, M$-CHAP2! + Firstly use plain text passwords with PAP for the beginning. I haven't + tested any other W2K version like W2K RAS, yet. + If you have any more experiences with it, tell me. + - Wildcard character processing bug. See above. + - If you use with kernel 2.0.x, you can get some strange messages in the log. + These are not too serious. Eg. IPX_DLITF. You can ignore them, this comes + from the original 2.3.1[01]. + I advice you, use kernel 2.2.x if you can. I used 2.3.10-CBCP with kernel + 2.0.35 half a year without any bigger trouble. + +Any comment, opinion or bug-report / oh no ;-) / would be appreciated. + +Our addresses are: +Programmer: +Zsolt Horvath +horzsol@freemail.hu + +Tester: +Attila Ruzsinszky +aruzsi@freemail.hu \ No newline at end of file --- ppp-2.4.1.uus.orig/README.CBCP.hu +++ ppp-2.4.1.uus/README.CBCP.hu @@ -0,0 +1,172 @@ +Ha valami nem tiszta, irj! +Ha atolvasod az angol nyelvu iromanyaimat is es talalsz benni nyelvi hibakat, +ird meg nekem, kijavitom. + +Nehany szo a fejlesztesrol. + +1. Forditas: +- Alapertelmezesben be van allitva az IPX_CHANGE es CBCP_SUPPORT define. +- A régebbi kerneleknél /kernel-verzió < 2.2.0 / a pppdefs.h-bol alapban + hianyzik a #define PPP_CBCP sor, emiatt a cbcp.c sajnos nem fordul. + A hiba oka, hogy bar a ppp csomag net konyvtaraban levo pppdefs.h-ban + szerepel, de a fordito az azonos nevu kernel header filet hasznalja, + abban viszont ez nincs meg... + +2. Telepites: +rpm-bol: + Mielott installalod ezt az rpm-et, tavolitsd el az eredeti ppp csomagot, + mert ez a CBCP kiegeszites (meg) nem resze a hivatalos ppp forrasnak, + ezert nem is kap ujabb verzioszamot. Mi mindig megproblajuk megpatch-elni az + ujabb ppp-ket, ha az idonk engedi. + Ebbol kifolyolag ne probobald meg upgradelni a hivatalos ppp csomagot az + rpm -U paranccsal, mert nem fog sikerulni. + Ha megis ezzel kezdted, akkor "konfliktus" lesz az eredmenye az elobbiek miatt. + Ha upgradelni akarsz, hasznald a --force parametert. Egyebkent eloszor az + rpm -e ppp-original.rpm (ahol az original az aktualis x.y.z verziot jelenti) + paranccsal tavolitsd el a mar fennt levo ppp csomagot es utana installald fel + a CBCP-s ppp-t. + + FIGYELEM !!! + Ne felejtsd el elmenteni, vagy lemasolni a /etc/ppp-ben levo file-okat! + Ha elfelejtetted, akkor ismet talahatod ki kedvenc internet szolgaltatod + parametereit. + + Azutan hogy az rpm -ih ppp-x.y.z-cbcpx.rpm paranccsal felinstallaltad a + csomagot, kerlek nezz bele a /usr/doc/ppp-x.y.z konyvtarba, mert itt talalhato + nehany a CBCP szamara nelkulozhetetlen file, script, mit callback-server, + -client, -users. A callback-users a sample alkonyvtarban, a tobbiek a scripts- + ben. + Masold oket a /etc/ppp-be! Nem tudom, hogy miert ez a szabvany az RH-nal es + miert ide a /usr/doc/ppp ala teszik a fontos file-okat, mint pl. ip-up, + auth-up stb. De ez a szabvany, mi pedig nem akartunk ez ellen veteni. + A sample alkonyvtarba betettem nehany sajat hasznalatu options file-t, mint + options-autopp ami az mgettz /AutoPPP/ funkciojahoz keszult es ezekkel a + parameterekkel hivodik meg a pppd, ill. az options.ttyS1.ipx minta file-t, + ami a kulonbozo IPX network number-ek beallitasat vegzi a ttyS1-es soros + vonali interfeszen. Ahhoz, hogy ezen utobbi file-t a pppd haszalni is tudja, + a vegerol a .ipx elhagyando. + +forras tgz-bol: + - a make install parancssal tortenik. A telepites soran a szokasos + allomanyokon kivul telepitesre kerul tovabbi harom allomany az /etc/ppp + konyvtarba: + - /etc/ppp/callback-client - a script visszahivast var a szervertol + - /etc/ppp/callback-server - a script a kliens visszahivasat vegzi. + - /etc/ppp/callback-users - fehasznalo - visszahivasi mod kapcsolat + - ha a modem valamilyen specialis inicializalast igenyel a visszahivas + elvegzese- vagy fogadasa eseten, akkor a callback-client/callback-server + script parost kell javitani. A ket script elso parametere mindket esetben + az az ertek masodpercben, amelyet a CBCP megadott, mint visszahivas elotti + varakozasi ido. A szerver script masodik parameterkent a visszahivando + szamot kapja meg. + +3. Hasznalat: +- a pppd visszahivast ker. Ekkor a callback parameter jarulekos parametere a + telefonszam, amlyen a szerver vissza tud hivni. A szam tenylegesen csak + akkor kerul felhasznalasra, ha a tuloldal fogadja a visszahivasi kerelmet + es a hivotol keri a visszahivando szamot. / Admin definied esetben - ertelem + szeruen - a szam nem kerul felhasznalasra, noha visszahivas tortenik. / + Telefonszamkent nem csak szamjegy adhato meg, tehat megadthato pl. + P01WT1234567 is. +- a pppd visszahivast vegez. Ekkor a callback utan a server szoveget kell + megadni. A visszahivas eseten tovabbi ket lehetoseg van attol fuggoen, + hogy eloirtunk-e authentikaciot. + - ha nem kertunk autentikhaciot, de eloirtuk a visszahivast, akkor mindig + a felhasznalo altal megadott szamon hiv vissza a pppd. + - authentikacio eseten az /etc/ppp/callback-users file-bol veszi, hogy a + megadott usert vissza kell-e hivni, illetve milyen szamon. + Alapertelmezesben aki nem szerepel a fileben, azt a szerver nem hivja + vissza. A file felepitese: + usernev opcio + Az usernevben * es ? is szerpelhet, de mindig a legpontosabb talalat + szamit. + Opcio: + - ha nincs megadva, vagy *, akkor user definied + - ha -, nincs visszahivas, + - egyeb ertek eseten admin definied, az egyeb ertek a visszahivando szam. + Pl.: + * * + pro* - + pro12 4567890 + Alapban mindenkit visszahiv /* user, * opcio/, de a pro-val kezdodo + usereket nem /pro* user, - opcio/, kiveve a pro12 user, aki a 4567890 + szamon hivando vissza. + A program helyesen ertelmezi a us*deve??01 kifejezest is. ;-) + (Legy ovatos! A program ezen resze sajnos bugos. Ellenorizd, mielott + hasznalod!) + +4. Hibak es javitasuk: +- ha a pppd callback server parameterrel indul, akkor elofordulhat, hogy + a kovetkezo hibauzenettel kilep: + Jul 22 08:41:36 haziko pppd[2886]: Callback with + Jul 22 08:41:36 haziko pppd[2886]: tcgetattr: Input/output error(5) + Jul 22 08:41:37 haziko pppd[2886]: Exit. + A hiba mindig akkor lep fel, ha a szerver oldali modem bont, amikor a ppp + meg nem lepett ki az adattovabbito ciklusbol. Jobb hijan ilyenkor a port + lezarasa es ujranyitasa a gyogyszer ra. / Javitva 980721 - main.c. / + + A CBCP ha nem kapja meg a kozvetett nyugtat a CBCP_ACK uzenetre, + hajlamos azt tobbszor is elkuldeni, igy mindig visszaalitva a + callback_in_progress valtozot, amely azt hivatott jelezni, hogy az + adattovabbito hurokbol valo kilepes utan viszzahivas tortenik. + Szinten problemat okozott, hogy ha semmilyen nyugtat nem kapott, + akkor egy ido utan lezarta a kapcsolatot, de ekkor is belepett a + visszahivasi hurokba. / Javitva 980725 - cbcp.c / + + Felmerult problema, hogy a callback-user filebol vett felhasznalo + eseten nem mindig talalja meg a keresett felhasznalot. A hiba + ellenorzese erdekeben a debug parancs hatasara a rutin log-ba irja + a keresett felhasznalo nevet, az ehhez legjobban hasonlito, altala + megtalalt bejegyzest, a talalati pontossagot, valamint az ehhez + tartozo opciot. + +Megjegyzesek az NT4 CBCP-s RAS-rol: + Reszletesebb kidolgozashoz tobb ido kellene. + + Ebben a szituacioban a Linux a CBCP kliens, aki a "callback tel_num" + parametert hasznalja, mig az NT4 RAS a CBCP szerver. + A legfontosabb a mukodeshez: a "receive-all" parameter, az m$-chap tamogatas + a pppd-be es termeszetesen a mi CBCP patch-unk. + Ne feledd a chap-secrets file helyes kitolteset sem! + Ide fogom tenni az elso sajat options file-omat, amivel sikerul a csatlakozas + a CBCP-s NT RAS-hoz. + Ez egy nagyon rovid How-To volt az NT-s csatlakozashoz. + Ha az alabbi szituacioval talalkozol, akkor hasznald a "receive-all"-t: + - A CBCP 2. fazisaban, amikor az NT visszahiv, a Linux "Bad FCS"-es LCP + kereseket vesz az NT-tol es igy a 10. sikertelen keres utan a kapcsolat + bontodik. + Az NT hibatlan LCP kereseket vesz a Linuxtol a ppp.log szerint. + +Bug-ok: + - Amikor az NT kliens nem akar visszahivast a Linuxos CBCP szervertol, a + kapcsolat szinten elbomlik. Egyenlore nem tudjuk miert. A logok elemzese + folyamatban. + - A Linux CBCP-ben levo bug miatt a Linux az NT RAS visszahivasi idoziteset + 0-ra allitja, a default 5s helyett. Nem veszelyes, mert a 0s mellett is + kb. 4-6s lesz az 1. fazis bontas es 2. fazis tarcsazas kozott. Dolgozunk + rajta. + - A CBCP megy a W2K klienssel. Az RC2-es angol verzioval tettem egy probat. + Az elso probak soran ne hasznalj semmilyen M$ specifikus titkositast, + mint Kerberos, M$-CHAP2 stb. Kezdeskor mindig legyen kodolatlan jelszo + PAP protokollal, majd ha mar megy, lehet tovabb finomitani a biztonsagot, + ha a Linux is ismeri oket. + Barmilyen tovabbi eszrevetel is erdekelne. W2K egyeb verzioit nem + teszteltem, mint pl. W2K RAS. + - Wildcard karakterek feldolgozasa bug-os. Lasd feljebb. + - Ha 2.0.x-es kernellel hasznalod, nem vart hibauzenetek kerulhetnek a log-ba. + Ezek nem tul komolyak, mint pl. IPX_DLITF. Eltekinthetsz toluk, mert ezek + az eredeti 2.3.1[01]-es ppp-tol jonnek 2.0.x-es kernelek alatt. + Azt tanacsolom, hogyha csak teheted, terj at a 2.2.x-es kernelre, bar ettol + fuggetlenul a CBCP megy a 2.0.x-essel is. En fel evig hasznaltam nagyobb + hiba nelkul. + +Az esetleges eszreveteleket, velemenyeket, esetleg bug-reportot / oh no ;-) / +ide kerem: + +Programozo: +Horvath Zsolt +horzsol@freemail.hu + +Tesztelo: +Ruzsinszky Attila +aruzsi@freemail.hu \ No newline at end of file --- ppp-2.4.1.uus.orig/README.CBCP.install.en +++ ppp-2.4.1.uus/README.CBCP.install.en @@ -0,0 +1,119 @@ +Some words about installing PPP with CBCP. + +This CBCP client and server extension for PPP was tested in Linux and Win9x, but it isn't "closed out" working with another client programs which implements CBCP. +Clients which hasn't tested, yet: +Win3.1x Wfw, +Trumpet Winsock, +FTP OnNet, +Novell Client +MacIntosh etc. + +The basic working condition of clients that must support CBCP protokol, which is an extension of the LCP definied in RFC1570. Another condition is the knowledge of PAP and/or CHAP authentication protocols. Now is possible to use CBCP without those auth. protocols, but in the future, PPP won't accept CBCP without authorization! +I'm sorry, but I don't know this kind of client programs, except Win9x, NT, (maybe Y2) and Linux, or other Unix platforms which use our patch. If you found them, used them and they work with our CBCP patch, notice me and I will modify this README. I'm interested in hearing any operating sytem which supports our CBCP implementation. + +I just tested the NT as client, because of my NT4.0 RAS didn't send back any packets to my Linux box! :-(( If you have any experience with NT RAS, please help me, or try to test our Linux client with CBCP. + +CBCP which was implemented by Zsolt Horvath the SERVER means: +Linux realizes callback. So it executes the callback if the given user has permission and the authorization is enabled. If there is no authentication, anyone will called back if he or she wants it! +CLIENT means: +Linux asks a CBCP server to callback it. PPP is able to work both mode on the same machine, but not for the same pppd process. In this situation you must give parameters or use different options file to setup pppds for incoming and outgoing calls. For example: There are two phone line. One of the is used for incoming calls. The other used for outgoing calls to Internet. The ISP uses NT RAS to accept calls and use admin defined callback to control the client who is able to surf on the Net. In this situation if a user try to connect our Linux box has to start two pppd. One in server mode with "callback server" parameter executing the user asked callback, and another with "callback phone_no" to initiate a callback request from NT RAS. +Because I don't have almost any experience in Linux-Linux CBCP connection (yet), please send me your question and I will pass to the programmer, my friend Zsolt Horvath. + +And now the substance, Win9x or NT with CBCP. + +The first condition is there must be a correctly working Win9x (NT)- Linux PPP connection without CBCP. It means, the PPP works perfectly both side. +If you don't know how can setup Dial-up Networking with Win9x (NT), ask me! I think it would be a little longer than this file, but I started writting that in HTML, full of images. :-) +On the Win9x client side there is nothing to configure or modify. +The Win tries CBCP by default and if the server accept it the connection will be succesfull with CBCP. +On the Linux there are three new file, which must be in the /etc/ppp directory. These are: + +1. callback-server script: +Owner: root.root +Permission: rwx------ +It gets two parameters: First, in how many secs starts the dialing to the CBCP- The second is the phone number what has to dial to reach the client, but it can consists of any AT commands without the AT prefix tag. For example: 00W06W123-4567, where the "W" means: the modem waits a given secs for dial tone. + +2. callback-client script: +Owner: root.root +Permission: rwx------ +It gets one parameter: callback delay time in secs. + +3. callback-users file: +Owner: root.root +Permission: rw------- +User rattila disabled from CBCP: rattila - +User will be called back at fix number: rattila 76-42 +User can give the number for CBCP: rattila * + +In that file can be used wildcard characters (? *) and the system uses the best fit pattern. +CAUTION! There is a bug somewhere in this subroutine so don't forget checking who will be called back before you put that characters in your callback-users file! If your system doesn't use PAP or CHAP authentication protocols, everyone will be called back, who wants it! +So be carefull with pppd parameters eg. auth +pap -chap login. +Restriction: the callback always initiates through that modem on which the CBCP was asked, so the user can't specify which modem used for callback, dynamically. + +The CBCP protocol will be accepted after the required authentication protocol. So user should use one of the auth. protocol (PAP, CHAP), but if you are the administrator, never entrusts it to users! +I use this setting: PAP with login option. In this situation the user is able to use PPP connection with his normal username and password pair. Then in the Dial-up networking window of Win9x must specify username and password, has to switch off the encrypted password requirement option and don't choose saving password, if you don't use alone the computer. +I don't have any succesfull experience, because PAP and login are more convenient than CHAP. Later, I will make some test with CHAP and M$-CHAP protocols. + +The checking of PAP or CHAP will be done after callback, but Win9x ask nothing again because all data is available for the newly initiated authentication. + +One possible solution: +mgetty+autoPPP + +1. First of all install mgetty and our PPP package with CBCP extension, if there isn't on the machine, yet. +2. Setup the mgetty for answer incoming calls. See man mgetty! + Don't forget modify mgetty.conf as your modem require. + Check the modem AT commands. + To start watching incoming calls by mgetty, modify inittab. + After modified config files, use init q. +3. Modify login.config file: + /AutoPPP/ - a_ppp /usr/sbin/pppd file /etc/ppp/options.autoppp +4. Fill up /etc/ppp/options.autoppp, like: (example) + auth + -chap + +pap + login + proxyarp + modem + lock + ipx + #debug + callback-server + + "auth" asks client authentication, + "-chap" refuse CHAP auth. protocol + "+pap" require PAP auth. protocol + "login" PAP uses normal username/password pair from /etc/passwd. + With this no need to store more than once passwords, so put just one line in the pap-secrets file: ** "" * + "proxyarp" the server side pppx interface (local) IP address will be the IP address of the first LAN card (eth0). See man pppd. + "modem" I think this option self-evident. We use modem not direct cable connection. + "lock" use the same locking mechanism, as mgetty. + "ipx" if you want use IPX protocol, too. Why not? + "debug" if something is not good and wants to put more info in the log. BE CAREFULL! The plain password can be read in the log if you don' disable it. + "callback-server" accept CBCP requies from the client and it will called be back, if there is in the callback-users file. See callback-users file. + +If you use this exmaple options.autoppp file you must explicite setup IP address for clients, otherwise the connection will be failed. See Win9x Dial-up networking -> Server types -> TCP/IP options -> IP address. +If there is a given IP address for every machine which connected your network by modem from the private IP address range eg. 192.168.x.y, then it is simplify DNS definition and log analyse. Think about firewall and proxy rules! +5. /etc/ppp/pap-secrets: + That's all you nedd to put into: + * * "" 192.168.x.0/24 + + You must specify an IP address range after PPP 2.3.5. + If you don't give, connection will be failed. + + +I use these options, parameters and it is working correctly. +I wish you pleasant PPP connections! + +If you have any experience in these topics: +CHAP with Win9x, +M$-CHAP with Win9x, NT. +Making packages from one PPP source with our CBCP patch with least work (Debian, RH, SuSE, etc.), +Using any other operating systems with CBCP (DOS, Win3.1x Wfw, etc.). + +If you interested in using IPX with PPP, I can give you my config. + +Any comments would be appreciated! +If you understood my thought but the grammar is terrible, please correct me! +Bye: + +Attila Ruzsinszky +aruzsi@freemail.hu \ No newline at end of file --- ppp-2.4.1.uus.orig/README.CBCP.install.hu +++ ppp-2.4.1.uus/README.CBCP.install.hu @@ -0,0 +1,168 @@ + +Nehany szo a CBCP-s PPP kapcsolat installalasarol. + +Ez a Linuxon futo CBCP szerver es kliens PPP protokol kiegeszites egyenlore csak +Win9x es Linux alatt lett tesztelve, de nem kizart, hogy mas a CBCP-t megvalosito +klienssel is hasznalhato. +Ezen nem kiprobalt kliensek: +Win3.1x Wfw, +Trumpet Winsock, +FTP OnNet, +Novell Client stb. + +A kliensek alapveto mukodesi feltetele, hogy tamogasak a CBCP protokollt, amely +az LCP kiterjesztesekent az RFC1570-ben van definialva. Tovabbi feltetel a PAP +es/vagy CHAP azonositasi protokollok ismerete, mert bar jelenleg lehetoseg van +azonositas nelkul is visszahivast kerni, de ez a jovoben valtozni, azaz nem lesz +visszahivas authentikacio nelkul! +Sajnos ilyen kliens programokrol nem tudok. Amennyiben ilyenek felbukkananak +valakinel es eljutatja hozzam, szivesen kiprobalnam, amint lesz eleg idom. + +Ezuton kernek mindenkit, hogy jelezze szamomra, milyen PPP-s programok leteznek +Win3.x, Novell Client, MacIntosh es estleg DOS ala, valamint azok elerhetoseget. +WinNT-n egyenlore csak mint kliens teszteltem, mert az NT-s RAS egyaltalan nem +kommunikal a behivo Linux klienssel. (a kiserletek tovabb folynak) +Szivesen vennem az ilyen iranyu kiserleteket, tapasztalatokat, segitseget! + +A CBCP protokollhoz keszult Horvath Zsolt altal megvalositott +CBCP szerver es kliens implementacional: +a SZERVER azt jelenti, hogy a Linux valositja meg a visszahivast, tehat o +kezdemenyezi a kliens visszahivasat, aszerint, hogy a usernek van-e joga a +visszahivasra, vagy se, ha az azonositas engedelyezve van. +a KLIENS azt jelenti, hogy o keri a CBCP szervert, hogy hivja vissza. +Tehat a Linux mindket modban mukodhet, akar egyszerre is, bar ekkor a pppd-t +meghivasa elott parameterezni kell, vagy kulonbozo options-t kell hasznalni a +ki- es behivashoz, mivel szerepelni kell az options-ban szervernel (behivaskor) +a "callback server", mig kliensnel a "callback tel_szam" parametereknek. Igy +elkepzelheto az az eset, hogy egy Linuxos szervertol a behivo user ker +visszahivast a telefonszamla csokkentese miatt, ugyanakkor ez a Linuxos gep az +Internetes elereshez egy WinNT-hez csatlakozik, amely ugy ellenorzi a hozza +modemen csatlakozo gepeket, hogy visszahivja oket, amely esetben a Linuxnak a +csatlakozashoz CBCP kliensnek kell lennie. +Mivel ahogy az elejen mar emlitettem Linux-Linux kapcsolattal (meg) nem probalkoztam, +ezert ezugyben forduljatok Horvath Zsolthoz! + +Es akkor most a lenyeg, Win9x visszahivassal (amely igaz NT kliensre is). + +Az elso feltetel, hogy a Win9x-Linux PPP-s kapcsolat HIBATLANUL mukodjon meg a +CBCP elott, azaz a CBCP nelkuli pppd-vel mukodjon a behivas. +Egyenlore ezt itt nem reszleteznem, de ha igeny jelentkezik erre, beveszem ebbe +a dokumentumba (vagy inkabb egy HTML oldalba). +A Win9x-nel kliens oldalan a CBCP-hez SEMMIT nem kell modositani, vagy beallitani! +A Win alapban megprobalja hasznalni a CBCP-t es ha a szerver ezt elfogadja, +akkor meg is valosul a visszahivas. +Linuxon harom uj file kerul felhasznalasra, amelyeknek a /etc/ppp konyvtarban +van a helyuk, hasonloan a tobbi PPP-hez szukseges file-hoz. Ezek: + +1. callback-server script: +Tulaj: root.root +Jogok: rwx------ +Ket parametert kap. Az elso hogy hany masodperc mulva kezdje meg a tarcsazast a +visszahivashoz. A masodik a visszahivando szam, de tartalmazhat modem AT parancsokat +is az AT kiirasa nelkul. Pl.: 00W06W123-4567, ahol a "W" azt jelenti, hogy adott +ideig varakozzon tarcsahanga. + +2. callback-client script: +Tulaj: root.root +Jogok: rwx------ +Egy parametert kap, az idozitesi parametert. + +3. callback-users file: +Tulaj: root.root +Jogok: rw------- +A user - rattila - kitiltva a visszahivasbol: rattila - +A user visszahivasa fix szamra: rattila 76-42 +A user adhatja meg a visszahivando szamot: rattila * + +Ebben a file-ban hasznalhatok a joker karakterek (? *) es a rendszer a legjobban +illeszkedo mintat fogja hasznalni. +FIGYELEM! Ez a programresz meg bugos, igy ellenorizendo, mielott elesben hasznalna +valaki. Probaljuk ki, nem hiv-e vissza olyan user-t is, akit nem kellene! +PAP, ill. CHAP azonositas nelkul BARKIT visszahiv, igy csak fokozott figyelemmel +parameterezzuk a pppd-t. Pl: auth +pap -chap login. +Korlatozas: a visszahivas mindig azon a modemen keresztul tortenik, amelyen a +visszahivast kertek, tehat a visszahivaskor nem adhato meg masik modem, +dinamikusan a user altal. + +A CBCP protokol elfogadasa mindig a megfelelo, vagy kert authentikacios +protokoll utan kerul egyeztetesre. Igy a usernek illdomos hasznalni valamelyik +authentikacios protokolt (PAP, CHAP), de ezt ne bizzuk a userre! +En a kovetkezo beallitast hasznalom: PAP protokol a login opcioval. Igy a user +a normal azonositojaval es jelszavaval hasznalhatja a PPP-s kapcsolatot. +Ekkor a Win9x telefonos halozat ablakaban meg kell adni a user nevet es a +jelszavat, ki kell kapcsolni a kodolt jelszo keres opciot es ne X-eljuk be a +jelszo elmenteset, ha nem egyedul hasznaljuk a gepet. + +A PAP, vagy CHAP ellenorzese a visszahivas utan is megtortenik, de a Win mar +nem kerdez semmit, mert az osszes adat a rendelkezesere all az ujboli +authentikalashoz. + +Egy lehetseges megoldas: +mgetty+autoPPP + +1. Installaljuk az mgetty es a CBCP-s PPP csomagot, ha meg nem lennenek a gepen. +2. Allitsuk be az mgetty-t a bejovo hivasok fogadasara. Lasd man mgetty! + Ne feljtsd el modositani az mgetty.conf-ot a modem leirasnak megfeleloen es + ujrainditani az mgetty processzt(eket) az uj konfig hasznalatahoz (init q)! +3. Modositsuk a login.config file-t az alabbiak szerint: + /AutoPPP/ - a_ppp /usr/sbin/pppd file /etc/ppp/options.autoppp +4. /etc/ppp/options.autoppp + auth + -chap + +pap + login + proxyarp + modem + lock + ipx + #debug + callback-server + + Az "auth" keri, hogy a kliens authentikalja magat a szerver fele. + "-chap" a CHAP protokol kikapcsolasat, vagy elutasitasat jelenti. + "+pap" a PAP protokol bekapcsolasat vagy megkoveteleset jelenti. + "login" a user a bejelentkezeshez a normal user/password parost hasznalhatja, + amely a passwd allomanybol (esetleg shadow) kerul kiertekelesre. + Ezzel a beallitassal a pap-secrets file-ban a jelszo resz uresen marad, + es igy nem kell tobb helyen nyilvantartani a jelszavakat. + "proxyarp" a pppx interface szerver oldali (lokalis) IP cime az elso LAN kartya cime + lesz. Lasd meg man pppd! + "modem" magaert beszel, azaz modemet hasznalunk, nem direkt vonalat. + "lock" lock-olasi mechanizmus megadasa. + "ipx" ha IPX-et is akarunk atvinni az IP mellett (miert ne?) + "debug" ha valami nem OK, es tobb infot akarunk a log-ban + VIGYAZAT! A jelszo is bekerul(het) a log-ba olvashato formaban! + "callback-server" elfogadjuk a CBCP kerest a klienstol, es vissza fogjuk hivni, + ha erre joga van. Lasd callback-users file! + +Ennek az options.autoppp file-nak a hasznalatanal a kliensnel MINDIG meg kell adni +a lokalis IP cimet, kulonben a kapcsolat nem fog osszejonni. Lasd Win9x telefonos +halozatnal a szerver beallitasai kozott azt az opciot, ahol nekunk kell megadni az +IP cimet. +Ha minden modemes gepnek sajat IP cimet adunk pl. a 192.168.x.y tartomanybol, +akkor ez nagy mertekben egyszerusiti a DNS beallitasat es a log-ok kiertekeleset, +hogy melyik geprol (IP cimrol) leptek be. Proxy, firewall beallitasok! +5. /etc/ppp/pap-secrets + Osszesen ennyi kell: + * * "" 192.168.1.0/24 + + Az IP cim vagy cimtartomany megadasa a 2.3.5-os PPP-nel kotelezo, az ures reszt, + vagy a *-ot nem fogadja el! + +En ezeket a beallitasokat hasznalom mar par eve es hiba nelkul megy. +Jo szorakozast es kevesebb telefonszamlat! + +Erdekelnenek tapasztalatok: +a CHAP-rol (Win9x, ha lehetseges egyaltalan) +az MS-CHAP-rol (WinNT) +Linux-Linux kapcsolatrol +Debianra csomaggyartas +mas PC-s op.rendszerek hasznalata (DOS, Win3.1x) + +Akit erdekel, tudok adni infot a PPP-s IPX-hez is. + +Barmilyen visszajelzest az alabbi cimre postazzatok: +aruzsi@freemail.hu + +Ruzsinszky Attila +