History log of /freebsd-11-stable/contrib/telnet/telnet/commands.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 351432 23-Aug-2019 emaste

MFC r351070: telnet: remove 3rd clause from Berkeley copyrights

Per the July 22, 1999 letter (in /COPYRIGHT) from
William Hoskins
Director, Office of Technology Licensing
University of California, Berkeley


# 350901 12-Aug-2019 emaste

MFC r350498: telnet: use asprintf for r350140 [MFC of r349890] change

Sponsored by: The FreeBSD Foundation


# 350140 19-Jul-2019 philip

MFC r349890:
telnet: fix a couple of snprintf() buffer overflows

Obtained from: Juniper Networks

MFC r349896:
telnet: fix minor style violationo

While here also fix a very unlikely NULL pointer dereference.

Submitted by: Shawn Webb <shawn.webb@hardenedbsd.org>


# 305552 07-Sep-2016 dim

MFC r305077:

Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey. This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC r305086:

Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
*lsrp++ = IPOPT_SSRR;
~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR 137 /* strict source route */
^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
*lsrp++ = IPOPT_LSRR;
~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR 131 /* loose source route */
^~~

Use unsigned char buffers instead.


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 274364 11-Nov-2014 ngie

Add baud rate support to telnet(1)

This implements part of RFC-2217

It's based off a patch originally written by Sujal Patel at Isilon, and
contributions from other Isilon employees.

PR: 173728
Phabric: D995
Reviewed by: markj, markm
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 207449 30-Apr-2010 jilles

telnet: Fix infinite loop if local output generates SIGPIPE.

Instead of catching SIGPIPE and jumping out of the signal handler with
longjmp, ignore it and handle write errors to the local output by exiting
from there. I have changed the error message to mention the local output
instead of NetBSD's wrong "Connection closed by foreign host". Write errors
to the network were already handled by exiting immediately and this now
applies to EPIPE too.

The code assumed that SIGPIPE could only be generated by the network
connection; if it was generated by the local output, it would longjmp out of
the signal handler and write an error message which caused another SIGPIPE.

PR: 19773
Obtained from: NetBSD
MFC after: 1 week


# 142790 28-Feb-2005 tobez

Increase usefulness of telnet(1) as a protocol tester. By prepending
"+" to the port number, disable option negotiation and allow
transferring of data with high bit set.

OKed by: markm (maintainer)
PR: 52032
Submitted by: Valentin Nechayev <netch maybe-at netch stop kiev stop ua>
MFC After: 2 weeks


# 139687 04-Jan-2005 maxim

o Print a correct status for unix domain sockets.
o Restore input mode when return from the command one.

PR: bin/49983
Submitted by: Volker Stolz
OK in general from: markm
MFC after: 1 month


# 121472 24-Oct-2003 ume

Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542
(aka RFC2292bis). Though I believe this commit doesn't break
backward compatibility againt existing binaries, it breaks
backward compatibility of API.
Now, the applications which use Advanced Sockets API such as
telnet, ping6, mld6query and traceroute6 use RFC3542 API.

Obtained from: KAME


# 121425 23-Oct-2003 ume

EAI_ADDRFAMILY and EAI_NODATA was deprecated in RFC3493
(aka RFC2553bis). Now, getaddrinfo(3) returns EAI_NONAME
instead of EAI_NODATA. Our getaddrinfo(3) nor getnameinfo(3)
didn't use EAI_ADDRFAMILY.

Obtained from: KAME


# 114911 11-May-2003 markm

Fix up external variables named "debug" that have a horrible habit
of conflicting with other, similarly named functions in static
libraries. This is done mostly by renaming the var if it is shared
amongst modules, or making it static otherwise.

OK'ed by: re(scottl)


# 114630 04-May-2003 obrien

Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3.


# 107299 27-Nov-2002 eric

Merge argument parsing changes into this copy of telnet.

Submitted by: markm
Approved by: bmah


# 104331 01-Oct-2002 dd

Permit the argument to the -s option to be a hostname. I see no
reason to restrict this to a numeric address.

PR: 41841
Submitted by: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>,
Maxim Maximov <mcsi@agava.com>


# 103955 25-Sep-2002 markm

Catch up with "base" telnet.

s/FALL THROUGH/FALLTHROUGH/ for lint(1).
s/Usage/usage/ for consistency.


# 96385 11-May-2002 alfred

unbreak build:

commands.c, sys_bsd.c: comment out/remove junk after #endif/#else
network.c, terminal.c, utlities.c: include stdlib.h for exit(3)


# 87277 03-Dec-2001 jhay

Protect variables and function prototypes that are only used in the INET6
case with an ifdef INET6.

This make the fixit floppy compile again.

Reviewed by: markm


# 87266 03-Dec-2001 markm

help the alphas out with the WARNS=2 stuff.


# 87155 30-Nov-2001 markm

Damn. The previous mega-commit was incomplete WRT ANSIfication. This
fixes that.


# 87139 30-Nov-2001 markm

Very large style makeover.

1) ANSIfy.
2) Clean up ifdefs so that
a) ones that never/always apply are appropriately either
fully removed, or just the #if junk is removed.
b) change #if defined(FOO) for appropiate values of FOO.
(currently AUTHENTICATION and ENCRYPTION)
3) WARNS=2 fixing
4) GC other unused stuff

This code can now be unifdef(1)ed to make non-crypto telnet.


# 82497 29-Aug-2001 markm

Manually unifdef(1) CRAY, UNICOS, hpux and sun uselsess code.


# 81965 20-Aug-2001 markm

Code merge and diff reduce with "base" telnet. This is the "later"
telnet, so it was treated as the reference code, except where later
commits were made to "base" telnet.


# 77095 23-May-2001 dillon

A feature to allow one to telnet to a unix domain socket. (MFC from
non-crypto version)

Also update the crypto telnet's man page to reflect other options
ported from the non-crypto version.

Obtained from: Lyndon Nerenberg <lyndon@orthanc.ab.ca>


# 69223 26-Nov-2000 kris

Correct definition of MAXHOSTNAMELEN in ifdef'ed code.

Submitted by: Edwin Groothuis <mavetju@chello.nl>
PR: bin/22787


# 68891 19-Nov-2000 kris

Fix a buffer overflow from a long local hostname.

Obtained from: OpenBSD


# 63662 20-Jul-2000 ume

Fix buffer size of ALIGNed buffer.

PR: bin/20053
Submitted by: Alex Kapranoff <alex@kapran.bitmcnit.bryansk.su>


# 63249 16-Jul-2000 peter

Forced commit. This is to try and help folks that used the international
crypto repo and have slightly different files but with the same version.
cvsup in 'checkout mode' has no trouble with this, but cvs can get really
silly about it.


# 62805 08-Jul-2000 ume

Make telnet -s work. It is corresponding to EAI_NONAME -> EAI_NODATA
change (getaddrinfo.c rev 1.12).


# 62773 07-Jul-2000 itojun

sync with usr.bin/telnet/commands.c 1.21 -> 1.22. pierre.dampure@alveley.org


# 57724 03-Mar-2000 shin

CMSG_XXX macros alignment fixes to follow RFC2292.

Approved by: jkh


# 57343 19-Feb-2000 shin

Use static buffer to save source route hostnames.

Approved by: jkh


# 57342 19-Feb-2000 shin

Print "Trying ..." for each host. Also cleanups for error printing.

Approved by: jkh

Submitted by: Ben Smithurst <ben@scientia.demon.co.uk>


# 57233 15-Feb-2000 shin

Fix bugs in telnet.

Sorry there were still several bugs.
-error retry at af missmatch was incomplete.
-af matching for source addr option was wrong
-socket was not freed at retry.

Approved by: jkh


# 57125 10-Feb-2000 shin

Add more dual stack consideration.

-Should retry as much as possible when some of source
routing intermediate hosts' address families missmatch
happened.
(such as when a host has only A record, and another host
has each of A and AAAA record.)

-Should retry as much as possible when dest addr and
source addr(specified with -s option) address family
missmatch happend

Approved by: jkh


# 57016 06-Feb-2000 shin

Fix telnet core dump at invalid service name specified.
Added an error check to avoid it.

Approved by: jkh

Submitted by: Robert Muir <rmuir@gibralter.net>


# 56870 29-Jan-2000 shin

Add NI_NAMEREQD flag to getnameinfo() call. Without this flag,
getnameinfo() don't return error at name resolving failure.
But it is used at doaddrlookup(-N) case in telnet, error need to be
returned to correctly initialize hostname buffer.

Discovered at checking recent KAME repository change, noticed by itojun.


# 56668 27-Jan-2000 shin

another tcp apps IPv6 updates.(should be make world safe)
ftp, telnet, ftpd, faithd
also telnet related sync with crypto, secure, kerberosIV

Obtained from: KAME project


# 49861 16-Aug-1999 nsayer

Fix int function without return (make consistent with neighbors)


# 47973 17-Jun-1999 ru

Merge from non-crypto version:
- "-N" option
- "-E" security fix
- "-s src_addr" option

Requested by: markm


# 29181 07-Sep-1997 markm

Bring the FreeBSD changes to the virgin sources.


# 29089 04-Sep-1997 markm

This commit was generated by cvs2svn to compensate for changes in r29088,
which included commits to RCS files with non-trunk default branches.


# 29088 04-Sep-1997 markm

Initial import of BSD telnet. This will be used to build the kerberised
telnet, and after userland diffs have been merged in, will be used to
build the non-kerberised sources as well. (See unifdef(1) for details)