Home | History | Annotate | Download | only in telnet
History log of /src/usr.bin/telnet/commands.c
RevisionDateAuthorComments
 1.80  08-Jul-2022  mlelstv Prevent crashes as shown in PR 56918.
 1.79  09-Jan-2021  christos preserve errno because we are doing system calls between error printing
and error setting.
 1.78  09-Jan-2021  christos restore perror -> warn (reported by Havard Eidnes)
 1.77  04-Oct-2019  mrg use memmove() instead of strncpy() for overlapping strings.
ensure nul termination.
 1.76  05-Jan-2019  maya Match the function prototype of encrypthandler instead of casting to it.
Make GCC 9 snapshot happier with the code

While here, remove unnecessary braces around return (KNF).
 1.75  05-Jan-2019  maya unifdef compatibility for old BSD servers. This has been
disabled, so no binary change. from openbsd.
 1.74  05-Jan-2019  maya Avoid unnecessary casts, from openbsd. No binary change.
 1.73  14-Dec-2018  christos minor cleanup:
- more const
- prevent overflow of the argument vector
- change a lot of unsigned to signed to eliminate casts
 1.72  14-Dec-2018  maya G/C In3270 - always false
 1.71  13-Dec-2018  maya unifdef TN3270 which is never defined (and wouldn't build if it was)
delete tn3270 file no longer needed.
SetIn3270(); expands to nothing now, so remove it.

No functional change.
 1.70  04-Oct-2016  joerg branches: 1.70.12; 1.70.14;
GC header left from earlier diagnostic test.
 1.69  04-Oct-2016  joerg Remove source routing support.
 1.68  09-Jan-2012  christos branches: 1.68.22;
PR/45805: Borodin Oleg: telnet/telnetd with -DAUTHENTICATION -DENCRYPTION
(rfc2941)
- Minimal diffs to separate MKCRYPTO from USE_KERBEROS
 1.67  18-Dec-2006  christos branches: 1.67.34;
volatile fixes from Anon Ymous
 1.66  11-May-2006  mrg end the argument list to exec*(3) with a NULL instead of a bare '0', as
the latter isn't a pointer context in these varargs functions.
 1.65  05-May-2006  rpaulo Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292).
* RFC 3542 isn't binary compatible with RFC 2292.
* RFC 2292 support is on by default but can be disabled.
* update ping6, telnet and traceroute6 to the new API.

From the KAME project (www.kame.net).
Reviewed by core.
 1.64  04-Apr-2006  christos Turn if/then/elif into a switch
 1.63  02-Feb-2006  he Rename debug to telnet_debug, to allow static linking with libssh.a.
 1.62  25-Jan-2006  christos fix compilation after changes to telopts. I will revisit this and constify
it later.
 1.61  03-Apr-2005  atatat charaters -> characters
 1.60  16-Nov-2004  itojun branches: 1.60.2;
NI_WITHSCOPEID was not picked up by IETF standardization process.
 1.59  20-Mar-2004  heas - deal with a dead tty in ttyflush() by cleaning-up and exiting instead of
returning a failure code and processing that all the way up the stack.
- deal with a dead peer similarly and do it without setjmp/longjmp() (at
christos' request).

These fix bin/20304 and my own observations when the remote abruptly closes
the connection.
 1.58  05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.57  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.56  14-Jul-2003  itojun more unifdef
 1.55  14-Jul-2003  itojun more unifdef
 1.54  14-Jul-2003  itojun remove unneeded #ifdef. (confirmed that same *.o is generated)
 1.53  12-Jul-2003  itojun use bounded copy ops
 1.52  12-Jul-2003  itojun strlcpy
 1.51  18-Jun-2003  christos Ansify.
 1.50  27-Apr-2003  jdolecek one <sys/cdefs.h> include is enough
fixes PR misc/21340 by Igor Sobrado
 1.49  23-Aug-2002  kanaoka - Support -4 and -6. Approved by itojun.
 1.48  14-Jun-2002  wiz De-register, de-__P. Remove #ifndef __STDC__ parts.
defines.h: Be more careful with braces in macro definitions.
 1.47  06-Jan-2002  sjg Make telnet escape work in tn3270

PR: 1816
 1.46  03-Sep-2001  itojun just to be sure, set telnetport to 0.
From: Pekka Savola <pekkas@netcore.fi>
 1.45  16-Jan-2001  cgd comment or delete text after CPP directives.
 1.44  03-Jan-2001  mjl Fix possible buffer overruns. From OpenBSD, but without breaking stuff.
 1.43  22-Jun-2000  thorpej Bring the telnet situation back into better shape. Specifically,
pull in just about all of the differences from the crypto-us telnet
suite (which includes Kerberos 4 and connection encryption support).
Also bring in the Kerberos 5 support from the Heimdal telnet, and
frob a little so that it can work with the non-Heimdal telnet suite.

There is still some work left to do, specifically:
- Add Heimdal's ticket forwarding support to the Berkeley Kerberos 4
module.
- Add connection encryption support to the Heimdal Kerberos 5
module. Hints on this can be taken from the MIT Kerberos 5
module which still exists in crypto-us.

However, even with the shortcomings listed above, this is a
better situation than using the stock Heimdal telnet suite,
which does not understand the IPSec policy stuff, and is also
based on much older code which contains bugs that we have already
fixed in the NetBSD sources.
 1.42  25-May-2000  itojun branches: 1.42.4;
add missing #ifdef INET6, to compile without -DINET6.
From: Mason Loring Bliss <mason@acheron.middleboro.ma.us>
 1.41  25-May-2000  blymn Convert telnet and top to the new termcap interface. This stops some
buffer overflows in top from ever happening.
 1.40  13-May-2000  itojun recover old error message on unknown service ("telnet localhost foo"
when foo is not valid). gai_strerror may be too generic.
fix suggested in openbsd camp.
 1.39  29-Feb-2000  itojun sync comment for sourceroute() to reality
 1.38  05-Feb-2000  itojun use getnameinfo for "Trying ::1..." message, to enable printing of
IPv6 scopeid.
 1.37  31-Jan-2000  itojun sync with latest libipsec/kernel.
 1.36  27-Jan-2000  itojun clarify reverse lookup and -N.
getaddrinfo(AI_CANONNAME) does not imply reverse lookup.
 1.35  13-Dec-1999  itojun remove setuid(getuid()). they are unnecessary as noone is going to
setuid telnet(1).

i'm not sure why it is here (maybe someone reused this code from
other setuid'ed program, or someone cut-and-pasted the code from
somewhere else?), it was from revision 1.1 (= 4.4BSD).

briefly discussed in: tech-net?
 1.34  03-Dec-1999  itojun clarify getaddrinfo() loop. try to contact all possible addresses
unless we experience fatal error.
XXX changed location of setuid(getuid()), may need someone's review.
 1.33  03-Dec-1999  itojun clarify reverse address lookup (-N). AI_NUMERICHOST is for forward lookup.

XXX RFC2553 does not say that AI_CANONNAME means reverse lookup.
we need to check if getaddrinfo(3) implementation is correct.
 1.32  30-Sep-1999  soren Remove extraneous colons and newlines from perror(3) arguments.
 1.31  28-Jul-1999  abs branches: 1.31.2;
Add -N option (numeric host address) - idea taken from FreeBSD.
Fix bug where -E8 would still pick up 0xFF as escape (again from FreeBSD)
 1.30  21-Jul-1999  jtk fix handling of port number preceded by minus sign to restore documented behavior
 1.29  14-Jul-1999  itojun clarify socket-connect trial loop. fix freeaddrinfo().
adjust indentation (commands.c uses sw=4 ts=8).
 1.28  12-Jul-1999  thorpej Whitespace cleanup.
 1.27  02-Jul-1999  itojun bark if mismatched address families are found on source route.
 1.26  02-Jul-1999  itojun IPv6-ready telnet.
source route (telnet @localhost@localhost) works for IPv6 as well.
 1.25  06-Nov-1998  christos - synchronize with the domestic version
- setupterm -> setup_term
- char -> unsigned char
 1.24  26-Jul-1998  mycroft const poisoning.
 1.23  09-Jul-1998  msaitoh Declare ints, too, don't default them.
 1.22  07-Jul-1998  fvdl Fix pasto in previous.
 1.21  06-Jul-1998  mrg - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
 1.20  30-Mar-1998  mrg use static int instead of static
 1.19  05-Mar-1998  thorpej Avoid GCC warning on m68k.
 1.18  04-Mar-1998  christos Adjust for tn3270 cleanup.
 1.17  03-Mar-1998  thorpej Add a cast to make the compiler happy on the Alpha.
 1.16  28-Feb-1998  enami Fix compile error of tn3270/tn3270; getpgrp() takes no argument.
 1.15  27-Feb-1998  christos WARNSify and fix problems passing int * -> long *
 1.14  24-Mar-1996  jtk sync up with domestic fixes
 1.13  28-Feb-1996  thorpej RCS id cosmetics.
 1.12  24-Feb-1996  jtk restore last of the lost local changes.
 1.11  24-Feb-1996  jtk replace another lost change: "help" is a valid hostname.
 1.10  24-Feb-1996  jtk update to 95.10.23 version of telnet
also, RCS ID police
 1.9  05-Jan-1996  tls contrary to unpopular opinion, 'help' is a perfectly valid hostname.
 1.8  03-Jan-1995  hpeyerl Squish #581.
 1.7  24-Dec-1994  cgd headers, and use INADDR_NONE appropriately.
 1.6  08-May-1994  mycroft 020 -> IPTOS_LOWDELAY
 1.5  25-Feb-1994  cgd new telnet from ftp.cray.com. Encryption support ripped out, pending
figuring out what to do about it...
 1.4  01-Aug-1993  mycroft Add RCS identifiers.
 1.3  29-May-1993  cgd fix sending simple commands, from Jonathan Stone <jonathan@CS.Stanford.EDU>
 1.2  19-Apr-1993  mycroft Cleanup for GCC 2.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.31.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.42.4.1  22-Jun-2000  thorpej Update from trunk:
Bring the telnet situation back into better shape. Specifically,
pull in just about all of the differences from the crypto-us telnet
suite (which includes Kerberos 4 and connection encryption support).
Also bring in the Kerberos 5 support from the Heimdal telnet, and
frob a little so that it can work with the non-Heimdal telnet suite.

There is still some work left to do, specifically:
- Add Heimdal's ticket forwarding support to the Berkeley Kerberos 4
module.
- Add connection encryption support to the Heimdal Kerberos 5
module. Hints on this can be taken from the MIT Kerberos 5
module which still exists in crypto-us.

However, even with the shortcomings listed above, this is a
better situation than using the stock Heimdal telnet suite,
which does not understand the IPSec policy stuff, and is also
based on much older code which contains bugs that we have already
fixed in the NetBSD sources.
 1.60.2.1  04-Apr-2005  tron Pull up revision 1.61 (requested by atatat in ticket #87):
charaters -> characters
 1.67.34.1  17-Apr-2012  yamt sync with head
 1.68.22.1  04-Nov-2016  pgoyette Sync with HEAD
 1.70.14.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.70.14.1  10-Jun-2019  christos Sync with HEAD
 1.70.12.2  18-Jan-2019  pgoyette Synch with HEAD
 1.70.12.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts

RSS XML Feed