diff -car netkit-combo-0.17/bsd-finger/finger/finger.h netkit-combo-0.17-patched/bsd-finger/finger/finger.h *** netkit-combo-0.17/bsd-finger/finger/finger.h Tue Sep 14 19:51:11 1999 --- netkit-combo-0.17-patched/bsd-finger/finger/finger.h Mon Aug 27 13:28:44 2001 *************** *** 39,44 **** --- 39,45 ---- #include #include + #include /* * All unique persons are linked in a list headed by "head" and linkd diff -car netkit-combo-0.17/netkit-ntalk/talkd/announce.c netkit-combo-0.17-patched/netkit-ntalk/talkd/announce.c *** netkit-combo-0.17/netkit-ntalk/talkd/announce.c Sun Jul 23 00:27:39 2000 --- netkit-combo-0.17-patched/netkit-ntalk/talkd/announce.c Mon Aug 27 13:26:28 2001 *************** *** 51,56 **** --- 51,57 ---- #include #include "prot_talkd.h" #include "proto.h" + #include /* * Announce an invitation to talk. diff -car netkit-combo-0.17/netkit-telnet/telnet/commands.cc netkit-combo-0.17-patched/netkit-telnet/telnet/commands.cc *** netkit-combo-0.17/netkit-telnet/telnet/commands.cc Sun Jul 23 13:16:24 2000 --- netkit-combo-0.17-patched/netkit-telnet/telnet/commands.cc Mon Aug 27 13:24:01 2001 *************** *** 86,95 **** #define HELPINDENT ((int) sizeof ("connect")) - #ifndef MAXHOSTNAMELEN - #define MAXHOSTNAMELEN 64 - #endif MAXHOSTNAMELEN - #if defined(HAS_IPPROTO_IP) && defined(IP_TOS) int tos = -1; #endif /* defined(HAS_IPPROTO_IP) && defined(IP_TOS) */ --- 86,91 ---- *************** *** 98,104 **** char *hostname; ! static char _hostname[MAXHOSTNAMELEN]; //typedef int (*intrtn_t)(int argc, const char *argv[]); --- 94,100 ---- char *hostname; ! static char *_hostname; //typedef int (*intrtn_t)(int argc, const char *argv[]); *************** *** 1632,1637 **** --- 1628,1637 ---- printf("?Already connected to %s\n", hostname); return 0; } + if (_hostname) { + delete[] _hostname; + _hostname = 0; + } if (argc < 2) { (void) strcpy(line, "open "); printf("(to) "); *************** *** 1702,1707 **** --- 1702,1708 ---- #endif if (inet_aton(hostp, &sn.sin_addr)) { sn.sin_family = AF_INET; + _hostname = new char[strlen(hostp) + 1]; strcpy(_hostname, hostp); hostname = _hostname; } *************** *** 1718,1725 **** #else /* defined(h_addr) */ memcpy((caddr_t)&sn.sin_addr, host->h_addr, host->h_length); #endif /* defined(h_addr) */ ! strncpy(_hostname, host->h_name, sizeof(_hostname)); ! _hostname[sizeof(_hostname)-1] = '\0'; hostname = _hostname; } else { herror(hostp); --- 1719,1726 ---- #else /* defined(h_addr) */ memcpy((caddr_t)&sn.sin_addr, host->h_addr, host->h_length); #endif /* defined(h_addr) */ ! _hostname = new char [strlen(host->h_name) + 1]; ! strcpy(_hostname, host->h_name); hostname = _hostname; } else { herror(hostp); *************** *** 2021,2027 **** int gotmachine = 0; int l1 = strlen(m1); int l2 = strlen(m2); ! char m1save[64]; if (skiprc) return; --- 2022,2028 ---- int gotmachine = 0; int l1 = strlen(m1); int l2 = strlen(m2); ! char m1save[strlen(m1) + 1]; if (skiprc) return; diff -car netkit-combo-0.17/netkit-telnet/telnet/sys_bsd.cc netkit-combo-0.17-patched/netkit-telnet/telnet/sys_bsd.cc *** netkit-combo-0.17/netkit-telnet/telnet/sys_bsd.cc Wed Sep 29 01:29:24 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnet/sys_bsd.cc Mon Aug 27 13:24:01 2001 *************** *** 189,194 **** --- 189,195 ---- * Various signal handling routines. */ + #if 0 static void deadpeer(int /*sig*/) { setcommandmode(); siglongjmp(peerdied, -1); *************** *** 215,220 **** --- 216,222 ---- return; } } + #endif #ifdef SIGWINCH static void sendwin(int /*sig*/) { *************** *** 236,244 **** --- 238,248 ---- #endif void sys_telnet_init(void) { + #if 0 signal(SIGINT, intr); signal(SIGQUIT, intr2); signal(SIGPIPE, deadpeer); + #endif #ifdef SIGWINCH signal(SIGWINCH, sendwin); #endif diff -car netkit-combo-0.17/netkit-telnet/telnet/telnet.cc netkit-combo-0.17-patched/netkit-telnet/telnet/telnet.cc *** netkit-combo-0.17/netkit-telnet/telnet/telnet.cc Sun Jul 23 12:24:53 2000 --- netkit-combo-0.17-patched/netkit-telnet/telnet/telnet.cc Mon Aug 27 13:24:01 2001 *************** *** 1142,1147 **** --- 1142,1148 ---- } } + /* OPT_REPLY_SIZE must be a multiple of 2. */ #define OPT_REPLY_SIZE 256 unsigned char *opt_reply; unsigned char *opt_replyp; *************** *** 1173,1178 **** --- 1174,1180 ---- void env_opt_add(const char *ep) { const char *vp; + const unsigned char *tp; unsigned char c; if (opt_reply == NULL) /*XXX*/ diff -car netkit-combo-0.17/netkit-telnet/telnetd/Makefile netkit-combo-0.17-patched/netkit-telnet/telnetd/Makefile *** netkit-combo-0.17/netkit-telnet/telnetd/Makefile Tue Dec 14 09:43:30 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/Makefile Mon Aug 27 13:24:01 2001 *************** *** 9,15 **** # take out -DPARANOID_TTYS. CFLAGS += '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS \ ! -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS # LIBS += $(LIBTERMCAP) OBJS = telnetd.o state.o termstat.o slc.o sys_term.o utility.o \ --- 9,17 ---- # take out -DPARANOID_TTYS. CFLAGS += '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS \ ! -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS \ ! # -DLOGIN_WRAPPER=\"/usr/lib/telnetd/login\" ! -DLOGIN_WRAPPER=\"/bin/login\" # LIBS += $(LIBTERMCAP) OBJS = telnetd.o state.o termstat.o slc.o sys_term.o utility.o \ diff -car netkit-combo-0.17/netkit-telnet/telnetd/ext.h netkit-combo-0.17-patched/netkit-telnet/telnetd/ext.h *** netkit-combo-0.17/netkit-telnet/telnetd/ext.h Sun Dec 12 23:59:44 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/ext.h Mon Aug 27 13:24:01 2001 *************** *** 86,92 **** extern int pcc, ncc; /* printf into netobuf */ ! void netoprintf(const char *fmt, ...) __attribute((format (printf, 1, 2))); extern int pty, net; extern char *line; --- 86,95 ---- extern int pcc, ncc; /* printf into netobuf */ ! /* void netoprintf(const char *fmt, ...) __attribute((format (printf, 1, 2))); */ ! #define netoprintf output_data ! int output_data(const char *, ...) __attribute((format (printf, 1, 2))); ! void output_datalen(const char *, int); extern int pty, net; extern char *line; *************** *** 182,188 **** --- 185,194 ---- void tty_tspeed(int); void willoption(int); void wontoption(int); + + #if 0 void writenet(unsigned char *, int); + #endif #if defined(ENCRYPT) extern void (*encrypt_output)(unsigned char *, int); diff -car netkit-combo-0.17/netkit-telnet/telnetd/issue.net.5 netkit-combo-0.17-patched/netkit-telnet/telnetd/issue.net.5 *** netkit-combo-0.17/netkit-telnet/telnetd/issue.net.5 Mon Jul 31 08:57:09 2000 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/issue.net.5 Mon Aug 27 13:24:01 2001 *************** *** 40,43 **** .Sh FILES .Pa /etc/issue.net .Sh "SEE ALSO" ! .Xr telnetd 8 --- 40,43 ---- .Sh FILES .Pa /etc/issue.net .Sh "SEE ALSO" ! .Xr in.telnetd 8 diff -car netkit-combo-0.17/netkit-telnet/telnetd/setproctitle.c netkit-combo-0.17-patched/netkit-telnet/telnetd/setproctitle.c *** netkit-combo-0.17/netkit-telnet/telnetd/setproctitle.c Sat Dec 11 08:06:39 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/setproctitle.c Mon Aug 27 13:24:01 2001 *************** *** 139,145 **** (void) strcpy(Argv[0], buf); p = &Argv[0][i]; while (p < LastArgv) ! *p++ = ' '; Argv[1] = NULL; } --- 139,145 ---- (void) strcpy(Argv[0], buf); p = &Argv[0][i]; while (p < LastArgv) ! *p++ = '\0'; Argv[1] = NULL; } diff -car netkit-combo-0.17/netkit-telnet/telnetd/slc.c netkit-combo-0.17-patched/netkit-telnet/telnetd/slc.c *** netkit-combo-0.17/netkit-telnet/telnetd/slc.c Sun Dec 12 23:59:44 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/slc.c Mon Aug 27 13:24:01 2001 *************** *** 183,189 **** else { snprintf(slcbuf+slcoff, sizeof(slcbuf)-slcoff, "%c%c", IAC, SE); slcoff += 2; ! writenet(slcbuf, slcoff); netflush(); /* force it out immediately */ } } --- 183,189 ---- else { snprintf(slcbuf+slcoff, sizeof(slcbuf)-slcoff, "%c%c", IAC, SE); slcoff += 2; ! output_datalen(slcbuf, slcoff); netflush(); /* force it out immediately */ } } diff -car netkit-combo-0.17/netkit-telnet/telnetd/state.c netkit-combo-0.17-patched/netkit-telnet/telnetd/state.c *** netkit-combo-0.17/netkit-telnet/telnetd/state.c Mon Dec 13 04:41:44 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/state.c Mon Aug 27 13:24:01 2001 *************** *** 37,42 **** --- 37,43 ---- char state_rcsid[] = "$Id: state.c,v 1.12 1999/12/12 19:41:44 dholland Exp $"; + #include #include "telnetd.h" int not42 = 1; *************** *** 1365,1371 **** ADD(IAC); ADD(SE); ! writenet(statusbuf, ncp - statusbuf); netflush(); /* Send it on its way */ DIAG(TD_OPTIONS, {printsub('>', statusbuf, ncp - statusbuf); netflush();}); --- 1366,1372 ---- ADD(IAC); ADD(SE); ! output_datalen(statusbuf, ncp - statusbuf); netflush(); /* Send it on its way */ DIAG(TD_OPTIONS, {printsub('>', statusbuf, ncp - statusbuf); netflush();}); diff -car netkit-combo-0.17/netkit-telnet/telnetd/sys_term.c netkit-combo-0.17-patched/netkit-telnet/telnetd/sys_term.c *** netkit-combo-0.17/netkit-telnet/telnetd/sys_term.c Fri Dec 17 23:28:47 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/sys_term.c Mon Aug 27 13:24:01 2001 *************** *** 41,48 **** #include "telnetd.h" #include "pathnames.h" - #include "logout.h" - #include "logwtmp.h" #if defined(__GLIBC__) && (__GLIBC__ >= 2) /* mmm, nonstandard */ --- 41,46 ---- *************** *** 681,687 **** --- 679,687 ---- memcpy(&argvfoo, &avs.argv, sizeof(argvfoo)); execv(loginprg, argvfoo); + openlog("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON); syslog(LOG_ERR, "%s: %m\n", loginprg); + closelog(); fatalperror(net, loginprg); } diff -car netkit-combo-0.17/netkit-telnet/telnetd/telnetd.8 netkit-combo-0.17-patched/netkit-telnet/telnetd/telnetd.8 *** netkit-combo-0.17/netkit-telnet/telnetd/telnetd.8 Mon Jul 31 08:57:10 2000 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/telnetd.8 Mon Aug 27 13:24:01 2001 *************** *** 33,42 **** .\" $Id: telnetd.8,v 1.18 2000/07/30 23:57:10 dholland Exp $ .\" .Dd December 29, 1996 ! .Dt TELNETD 8 .Os "Linux NetKit (0.17)" .Sh NAME ! .Nm telnetd .Nd DARPA .Tn telnet protocol server --- 33,42 ---- .\" $Id: telnetd.8,v 1.18 2000/07/30 23:57:10 dholland Exp $ .\" .Dd December 29, 1996 ! .Dt IN.TELNETD 8 .Os "Linux NetKit (0.17)" .Sh NAME ! .Nm in.telnetd .Nd DARPA .Tn telnet protocol server *************** *** 52,63 **** .Op Fl debug Ar port .Sh DESCRIPTION The ! .Nm telnetd program is a server which supports the .Tn DARPA .Tn telnet interactive communication protocol. ! .Nm Telnetd is normally invoked by the internet server (see .Xr inetd 8 ) for requests to connect to the --- 52,63 ---- .Op Fl debug Ar port .Sh DESCRIPTION The ! .Nm in.telnetd program is a server which supports the .Tn DARPA .Tn telnet interactive communication protocol. ! .Nm In.telnetd is normally invoked by the internet server (see .Xr inetd 8 ) for requests to connect to the *************** *** 69,94 **** The .Fl debug option may be used to start up ! .Nm telnetd manually, instead of through .Xr inetd 8 . If started up this way, .Ar port may be specified to run ! .Nm telnetd on an alternate .Tn TCP port number. .Pp The ! .Nm telnetd program accepts the following options: .Bl -tag -width "-a authmode" .It Fl a Ar authmode This option may be used for specifying what mode should be used for authentication. Note that this option is only useful if ! .Nm telnetd has been compiled with support for authentication, which is not available in the current version. The following values of .Ar authmode --- 69,94 ---- The .Fl debug option may be used to start up ! .Nm in.telnetd manually, instead of through .Xr inetd 8 . If started up this way, .Ar port may be specified to run ! .Nm in.telnetd on an alternate .Tn TCP port number. .Pp The ! .Nm in.telnetd program accepts the following options: .Bl -tag -width "-a authmode" .It Fl a Ar authmode This option may be used for specifying what mode should be used for authentication. Note that this option is only useful if ! .Nm in.telnetd has been compiled with support for authentication, which is not available in the current version. The following values of .Ar authmode *************** *** 125,134 **** .El .It Fl D Ar debugmode This option may be used for debugging purposes. This allows ! .Nm telnetd to print out debugging information to the connection, allowing the user to see what ! .Nm telnetd is doing. There are several possible values for .Ar debugmode: .Bl -tag -width exercise --- 125,134 ---- .El .It Fl D Ar debugmode This option may be used for debugging purposes. This allows ! .Nm in.telnetd to print out debugging information to the connection, allowing the user to see what ! .Nm in.telnetd is doing. There are several possible values for .Ar debugmode: .Bl -tag -width exercise *************** *** 143,149 **** going on. .It Cm netdata Displays the data stream received by ! .Nm telnetd. .It Cm ptydata Displays data written to the pty. .It Cm exercise --- 143,149 ---- going on. .It Cm netdata Displays the data stream received by ! .Nm in.telnetd. .It Cm ptydata Displays data written to the pty. .It Cm exercise *************** *** 151,157 **** .El .It Fl edebug If ! .Nm telnetd has been compiled with support for encryption, then the .Fl edebug option may be used to enable encryption debugging code. --- 151,157 ---- .El .It Fl edebug If ! .Nm in.telnetd has been compiled with support for encryption, then the .Fl edebug option may be used to enable encryption debugging code. *************** *** 161,173 **** .It Fl L Ar loginprg This option may be used to specify a different login program. By default, ! .Pa /bin/login is used. .It Fl n Disable .Dv TCP keep-alives. Normally ! .Nm telnetd enables the .Tn TCP keep-alive mechanism to probe connections that --- 161,173 ---- .It Fl L Ar loginprg This option may be used to specify a different login program. By default, ! .Pa /usr/lib/telnetd/login is used. .It Fl n Disable .Dv TCP keep-alives. Normally ! .Nm in.telnetd enables the .Tn TCP keep-alive mechanism to probe connections that *************** *** 177,183 **** be reached may be cleaned up. .It Fl s This option is only enabled if ! .Nm telnetd is compiled with support for .Tn SecurID cards. --- 177,183 ---- be reached may be cleaned up. .It Fl s This option is only enabled if ! .Nm in.telnetd is compiled with support for .Tn SecurID cards. *************** *** 199,222 **** .Ar tos . .It Fl X Ar authtype This option is only valid if ! .Nm telnetd has been built with support for the authentication option. It disables the use of .Ar authtype authentication, and can be used to temporarily disable a specific authentication type without having to recompile ! .Nm telnetd . .El .Pp If the file .Pa /etc/issue.net is present, ! .Nm telnetd will display its contents before the login prompt of a telnet session (see .Xr issue.net 5 ) . .Pp ! .Nm Telnetd operates by allocating a pseudo-terminal device (see .Xr pty 4 ) for a client, then creating a login process which has --- 199,222 ---- .Ar tos . .It Fl X Ar authtype This option is only valid if ! .Nm in.telnetd has been built with support for the authentication option. It disables the use of .Ar authtype authentication, and can be used to temporarily disable a specific authentication type without having to recompile ! .Nm in.telnetd . .El .Pp If the file .Pa /etc/issue.net is present, ! .Nm in.telnetd will display its contents before the login prompt of a telnet session (see .Xr issue.net 5 ) . .Pp ! .Nm In.telnetd operates by allocating a pseudo-terminal device (see .Xr pty 4 ) for a client, then creating a login process which has *************** *** 225,231 **** .Dv stdout , and .Dv stderr . ! .Nm Telnetd manipulates the master side of the pseudo-terminal, implementing the .Tn telnet --- 225,231 ---- .Dv stdout , and .Dv stderr . ! .Nm In.telnetd manipulates the master side of the pseudo-terminal, implementing the .Tn telnet *************** *** 235,241 **** When a .Tn telnet session is started up, ! .Nm telnetd sends .Tn telnet options to the client side indicating --- 235,241 ---- When a .Tn telnet session is started up, ! .Nm in.telnetd sends .Tn telnet options to the client side indicating *************** *** 267,273 **** enabled (see .Xr tty 4 ) . .Pp ! .Nm Telnetd has support for enabling locally the following .Tn telnet options: --- 267,273 ---- enabled (see .Xr tty 4 ) . .Pp ! .Nm In.telnetd has support for enabling locally the following .Tn telnet options: *************** *** 284,296 **** When terminal echo is not desired, a .Dv WILL ECHO is sent to indicate that ! .Tn telnetd will take care of echoing any data that needs to be echoed to the terminal, and then nothing is echoed. When terminal echo is desired, a .Dv WONT ECHO is sent to indicate that ! .Tn telnetd will not be doing any terminal echoing, so the client should do any terminal echoing that is needed. .It "WILL BINARY" --- 284,296 ---- When terminal echo is not desired, a .Dv WILL ECHO is sent to indicate that ! .Tn in.telnetd will take care of echoing any data that needs to be echoed to the terminal, and then nothing is echoed. When terminal echo is desired, a .Dv WONT ECHO is sent to indicate that ! .Tn in.telnetd will not be doing any terminal echoing, so the client should do any terminal echoing that is needed. .It "WILL BINARY" *************** *** 322,341 **** session is shut down. .It "WILL ENCRYPT" Only sent if ! .Nm telnetd is compiled with support for data encryption, and indicates a willingness to decrypt the data stream. .El .Pp ! .Nm Telnetd has support for enabling remotely the following .Tn TELNET options: .Bl -tag -width "DO AUTHENTICATION" .It "DO BINARY" Sent to indicate that ! .Tn telnetd is willing to receive an 8 bit data stream. .It "DO LFLOW" Requests that the client handle flow control --- 322,341 ---- session is shut down. .It "WILL ENCRYPT" Only sent if ! .Nm in.telnetd is compiled with support for data encryption, and indicates a willingness to decrypt the data stream. .El .Pp ! .Nm In.telnetd has support for enabling remotely the following .Tn TELNET options: .Bl -tag -width "DO AUTHENTICATION" .It "DO BINARY" Sent to indicate that ! .Tn in.telnetd is willing to receive an 8 bit data stream. .It "DO LFLOW" Requests that the client handle flow control *************** *** 377,388 **** variable information, as described in RFC 1408. .It "DO LINEMODE" Only sent if ! .Nm telnetd is compiled with support for linemode, and requests that the client do line by line processing. .It "DO TIMING-MARK" Only sent if ! .Nm telnetd is compiled with support for both linemode and kludge linemode, and the client responded with .Dv WONT LINEMODE. --- 377,388 ---- variable information, as described in RFC 1408. .It "DO LINEMODE" Only sent if ! .Nm in.telnetd is compiled with support for linemode, and requests that the client do line by line processing. .It "DO TIMING-MARK" Only sent if ! .Nm in.telnetd is compiled with support for both linemode and kludge linemode, and the client responded with .Dv WONT LINEMODE. *************** *** 395,407 **** option can be used to disable this. .It "DO AUTHENTICATION" Only sent if ! .Nm telnetd is compiled with support for authentication, and indicates a willingness to receive authentication information for automatic login. .It "DO ENCRYPT" Only sent if ! .Nm telnetd is compiled with support for data encryption, and indicates a willingness to decrypt the data stream. --- 395,407 ---- option can be used to disable this. .It "DO AUTHENTICATION" Only sent if ! .Nm in.telnetd is compiled with support for authentication, and indicates a willingness to receive authentication information for automatic login. .It "DO ENCRYPT" Only sent if ! .Nm in.telnetd is compiled with support for data encryption, and indicates a willingness to decrypt the data stream. *************** *** 465,471 **** .Pp Because of bugs in the original 4.2 BSD .Xr telnet 1 , ! .Nm telnetd performs some dubious protocol exchanges to try to discover if the remote client is, in fact, a 4.2 BSD .Xr telnet 1 . --- 465,471 ---- .Pp Because of bugs in the original 4.2 BSD .Xr telnet 1 , ! .Nm in.telnetd performs some dubious protocol exchanges to try to discover if the remote client is, in fact, a 4.2 BSD .Xr telnet 1 . *************** *** 477,483 **** The terminal type name received from the remote client is converted to lower case. .Pp ! .Nm Telnetd never sends .Tn TELNET .Dv IAC GA --- 477,483 ---- The terminal type name received from the remote client is converted to lower case. .Pp ! .Nm In.telnetd never sends .Tn TELNET .Dv IAC GA diff -car netkit-combo-0.17/netkit-telnet/telnetd/telnetd.c netkit-combo-0.17-patched/netkit-telnet/telnetd/telnetd.c *** netkit-combo-0.17/netkit-telnet/telnetd/telnetd.c Thu Apr 13 06:36:12 2000 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/telnetd.c Mon Aug 27 13:24:01 2001 *************** *** 82,88 **** --- 82,92 ---- int debug = 0; int keepalive = 1; + #ifdef LOGIN_WRAPPER + char *loginprg = LOGIN_WRAPPER; + #else char *loginprg = _PATH_LOGIN; + #endif char *progname; extern void usage(void); *************** *** 108,114 **** nclearto = 0; #endif ! progname = *argv; while ((ch = getopt(argc, argv, "d:a:e:lhnr:I:D:B:sS:a:X:L:")) != EOF) { switch(ch) { --- 112,118 ---- nclearto = 0; #endif ! progname = strdup(*argv); while ((ch = getopt(argc, argv, "d:a:e:lhnr:I:D:B:sS:a:X:L:")) != EOF) { switch(ch) { *************** *** 354,360 **** #ifdef BFTPDAEMON fprintf(stderr, " [-B]"); #endif ! fprintf(stderr, " [-debug]"); #ifdef DIAGNOSTICS fprintf(stderr, " [-D (options|report|exercise|netdata|ptydata)]\n\t"); #endif --- 358,364 ---- #ifdef BFTPDAEMON fprintf(stderr, " [-B]"); #endif ! fprintf(stderr, " [-debug port]"); #ifdef DIAGNOSTICS fprintf(stderr, " [-D (options|report|exercise|netdata|ptydata)]\n\t"); #endif *************** *** 373,379 **** #ifdef AUTHENTICATE fprintf(stderr, " [-X auth-type]"); #endif ! fprintf(stderr, " [port]\n"); exit(1); } --- 377,383 ---- #ifdef AUTHENTICATE fprintf(stderr, " [-X auth-type]"); #endif ! fprintf(stderr, "\n"); exit(1); } *************** *** 620,626 **** */ pty = getpty(); if (pty < 0) ! fatal(net, "All network ports in use"); /* get name of connected client */ hp = gethostbyaddr((char *)&who->sin_addr, sizeof (struct in_addr), --- 624,630 ---- */ pty = getpty(); if (pty < 0) ! fatalperror(net, "getpty"); /* get name of connected client */ hp = gethostbyaddr((char *)&who->sin_addr, sizeof (struct in_addr), diff -car netkit-combo-0.17/netkit-telnet/telnetd/termstat.c netkit-combo-0.17-patched/netkit-telnet/telnetd/termstat.c *** netkit-combo-0.17/netkit-telnet/telnetd/termstat.c Sun Dec 12 23:59:45 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/termstat.c Mon Aug 27 13:24:01 2001 *************** *** 128,134 **** void localstat() { - void netflush(); int need_will_echo = 0; /* --- 128,133 ---- diff -car netkit-combo-0.17/netkit-telnet/telnetd/utility.c netkit-combo-0.17-patched/netkit-telnet/telnetd/utility.c *** netkit-combo-0.17/netkit-telnet/telnetd/utility.c Sun Dec 12 23:59:45 1999 --- netkit-combo-0.17-patched/netkit-telnet/telnetd/utility.c Mon Aug 27 13:24:02 2001 *************** *** 38,45 **** "$Id: utility.c,v 1.11 1999/12/12 14:59:45 dholland Exp $"; #define PRINTOPTIONS ! #include #include #ifdef AUTHENTICATE --- 38,46 ---- "$Id: utility.c,v 1.11 1999/12/12 14:59:45 dholland Exp $"; #define PRINTOPTIONS ! #define _GNU_SOURCE #include + #include #include #ifdef AUTHENTICATE *************** *** 52,57 **** --- 53,105 ---- * utility functions performing io related tasks */ + /* + * This function appends data to nfrontp and advances nfrontp. + * Returns the number of characters written altogether (the + * buffer may have been flushed in the process). + */ + + int + output_data(const char *format, ...) + { + va_list args; + int len; + char *buf; + + va_start(args, format); + if ((len = vasprintf(&buf, format, args)) == -1) + return -1; + output_datalen(buf, len); + va_end(args); + free(buf); + return (len); + } + + void + output_datalen(const char *buf, int len) + { + int remaining, copied; + + remaining = BUFSIZ - (nfrontp - netobuf); + while (len > 0) { + /* Free up enough space if the room is too low*/ + if ((len > BUFSIZ ? BUFSIZ : len) > remaining) { + netflush(); + remaining = BUFSIZ - (nfrontp - netobuf); + } + + /* Copy out as much as will fit */ + copied = remaining > len ? len : remaining; + memmove(nfrontp, buf, copied); + nfrontp += copied; + len -= copied; + remaining -= copied; + buf += copied; + } + return; + } + + /** void netoprintf(const char *fmt, ...) { *************** *** 67,73 **** va_end(ap); if (len<0 || len==maxsize) { ! /* didn't fit */ netflush(); } else { --- 115,121 ---- va_end(ap); if (len<0 || len==maxsize) { ! / * did not fit * / netflush(); } else { *************** *** 76,81 **** --- 124,130 ---- } nfrontp += len; } + */ /* * ttloop *************** *** 273,282 **** --- 322,336 ---- int n; if ((n = nfrontp - nbackp) > 0) { + + #if 0 + /* XXX This causes output_data() to recurse and die */ DIAG(TD_REPORT, { netoprintf("td: netflush %d chars\r\n", n); n = nfrontp - nbackp; /* update count */ }); + #endif + #if defined(ENCRYPT) if (encrypt_output) { char *s = nclearto ? nclearto : nbackp; *************** *** 310,320 **** } } } ! if (n < 0) { ! if (errno == EWOULDBLOCK || errno == EINTR) ! return; ! cleanup(0); ! } nbackp += n; #if defined(ENCRYPT) if (nbackp > nclearto) --- 364,377 ---- } } } ! ! if (n == -1) { ! if (errno == EWOULDBLOCK || errno == EINTR) ! return; ! cleanup(0); ! /* NOTREACHED */ ! } ! nbackp += n; #if defined(ENCRYPT) if (nbackp > nclearto) *************** *** 332,338 **** return; } /* end of netflush */ ! /* * writenet * --- 389,395 ---- return; } /* end of netflush */ ! #if 0 /* * writenet * *************** *** 355,361 **** nfrontp += len; } /* end of writenet */ ! /* * miscellaneous functions doing a variety of little jobs follow ... --- 412,418 ---- nfrontp += len; } /* end of writenet */ ! #endif /* * miscellaneous functions doing a variety of little jobs follow ... diff -car netkit-combo-0.17/netkit-timed/timed/timed/timed.c netkit-combo-0.17-patched/netkit-timed/timed/timed/timed.c *** netkit-combo-0.17/netkit-timed/timed/timed/timed.c Mon Dec 13 03:05:07 1999 --- netkit-combo-0.17-patched/netkit-timed/timed/timed/timed.c Mon Aug 27 13:58:49 2001 *************** *** 71,76 **** --- 71,77 ---- int daemon(int, int); #endif + #include int trace = 0; int sock, sock_raw = -1; *************** *** 898,904 **** void get_goodgroup(int force) { ! # define NG_DELAY (30*60*CLK_TCK) /* 30 minutes */ static unsigned long last_update = -NG_DELAY; unsigned long new_update; /* struct hosttbl *htp; */ --- 899,906 ---- void get_goodgroup(int force) { ! /* #define NG_DELAY (30*60*CLK_TCK) 30 minutes */ ! #define NG_DELAY (30*60*CLOCKS_PER_SEC) /* 30 minutes */ static unsigned long last_update = -NG_DELAY; unsigned long new_update; /* struct hosttbl *htp; */ diff -car netkit-combo-0.17/netwrite/write/write.c netkit-combo-0.17-patched/netwrite/write/write.c *** netkit-combo-0.17/netwrite/write/write.c Mon Dec 13 04:56:40 1999 --- netkit-combo-0.17-patched/netwrite/write/write.c Mon Aug 27 13:29:40 2001 *************** *** 73,81 **** #include #include #include ! #if 0 ! #include ! #endif #include #include #include --- 73,80 ---- #include #include #include ! #include ! #include #include #include