Commit Graph

83 Commits

Author SHA1 Message Date
Stephen Heumann
1c8d72b2d1 telnet: Define signal handlers on GNO with the proper signature (taking two arguments). 2015-06-01 17:55:24 -05:00
Stephen Heumann
a1e8056a8b Remove (most) instances of casting between incompatible function pointer types in telnet/commands.c.
This was generally resolved by adding extra unused parameters to functions, to standardize their signature to what their pointer was being cast to.

This should avoid issues of possible stack corruption due to the ORCA/C calling convention.
2015-06-01 17:33:25 -05:00
Stephen Heumann
391736d065 Remove source files needed only for authentication or encryption, which we've disabled. 2015-05-31 22:55:19 -05:00
Stephen Heumann
e39285b030 Add missing inet_ntop function 2015-05-31 21:39:51 -05:00
Stephen Heumann
4f442220c5 Add strlcpy, which GNO's libc doesn't have. 2015-05-31 20:23:06 -05:00
Stephen Heumann
923ec4e425 Transform (v)fork calls to use GNO's fork2 call. 2015-05-31 19:54:10 -05:00
Stephen Heumann
de9fad8d67 More small changes for GNO and ORCA/C compatibility.
In particular, address a couple instances where GNO's sockets implementation doesn't comply with modern standards.
Also, add a few missing prototypes so we can use ORCA/C prototype-checking lint functionality.
2015-05-31 19:52:28 -05:00
Stephen Heumann
9bab5c3dec Add an implementation of getaddrinfo and getnameinfo, which are missing in GNO.
These are adapted from a version in netperf.
2015-05-31 16:56:05 -05:00
Stephen Heumann
581990e767 Misc. small changes for GNO and ORCA/C compatibility 2015-05-31 15:27:34 -05:00
Stephen Heumann
e8c6388223 Get rid of __FBSDID macros, which aren't defined in GNO (and thus prevent compilation). 2015-05-30 22:26:48 -05:00
Stephen Heumann
327170235b Changes to make telnet & telnetd compile on OS X, and begin adapting them to GNO:
*New makefile
*Refer to local versions of telnet-related headers, rather than system ones
*Use termcap instead of termios
*Change hostname lookup in telnetd back to older code (which assumes IPv4, but that's all GNO supports anyway)
2015-05-30 22:12:01 -05:00
ngie
052bf438de 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@274364 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2014-11-11 04:06:05 +00:00
joel
2e1696417c Remove superfluous paragraph macro.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@237190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2012-06-17 11:04:38 +00:00
dim
24a5c1e093 In contrib/telnet/telnet/utilities.c, fix a few warnings about format
strings not being literals.

MFC after:	1 week


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@228651 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2011-12-17 18:18:36 +00:00
jilles
0fddcbcf1c 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@207449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2010-04-30 19:52:35 +00:00
ed
67287bcb77 Use <termios.h> instead of <sys/termios.h>.
<sys/termios.h> only works on FreeBSD by accident.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@199874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2009-11-28 11:57:25 +00:00
gnn
dea97c6292 Commit IPv6 support for FAST_IPSEC to the tree.
This commit includes all remaining changes for the time being including
user space updates.

Submitted by:    bz
Approved by:    re


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@171135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2007-07-01 12:08:08 +00:00
ru
461fc455ee Markup nits.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@162826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2006-09-29 22:51:29 +00:00
maxim
2a1a3f355d o Mention .telnetrc DEFAULT keyword.
PR:		bin/100496 (sort of)
Obtained from:	NetBSD, heas@netbsd
MFC after:	3 weeks


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@162402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2006-09-18 15:03:18 +00:00
nectar
e1492a80cd Correct a pair of buffer overflows in the telnet(1) command:
(CAN-2005-0468) A heap buffer overflow in env_opt_add() and related
 functions.

 (CAN-2005-0469) A global uninitialized data section buffer overflow in
 slc_add_reply() and related functions.

As a result of these vulnerabilities, it may be possible for a malicious
telnet server or active network attacker to cause telnet(1) to execute
arbitrary code with the privileges of the user running it.

Security: CAN-2005-0468, CAN-2005-0469
Security: FreeBSD-SA-05:01.telnet
Security: http://www.idefense.com/application/poi/display?id=220&type=vulnerabilities
Security: http://www.idefense.com/application/poi/display?id=221&type=vulnerabilities

These fixes are based in part on patches
Submitted by:	Solar Designer <solar@openwall.com>


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@144231 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2005-03-28 14:45:12 +00:00
tobez
0f4e951657 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@142790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2005-02-28 12:46:53 +00:00
ru
26fb67c648 - Soften sentence breaks.
- Remove double whitespace.
- Sort sections.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@140601 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2005-01-21 21:57:05 +00:00
maxim
82ff960df9 o Make telnet[d] -S (IP TOS) flag really work. We do not have
/etc/iptos implementation so only numeric values supported.

o telnetd.8: steal the -S flag description from telnet.1, bump
the date of the document.

MFC after:	6 weeks


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@139937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2005-01-09 10:24:46 +00:00
maxim
e5dfcfd096 o Remove -t flag from getopt(3), it was killed in rev. 1.15 three
years ago.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@139711 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2005-01-05 09:47:10 +00:00
maxim
cff120dc74 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@139687 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2005-01-04 21:22:32 +00:00
ume
97005ca0b5 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@121472 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2003-10-24 18:26:30 +00:00
ume
425407c55a 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@121425 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2003-10-23 13:55:36 +00:00
markm
4369ac2a7f 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)


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@114911 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2003-05-11 18:17:00 +00:00
obrien
90a2e082b9 Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@114630 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2003-05-04 02:54:49 +00:00
eric
9e0282c9ca Merge argument parsing changes into this copy of telnet.
Submitted by:	markm
Approved by:	bmah


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@107299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-11-27 06:34:24 +00:00
dd
a2b2e46019 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>


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@104331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-10-02 00:27:14 +00:00
markm
112a50cd56 Catch up with "base" telnet.
s/FALL THROUGH/FALLTHROUGH/ for lint(1).
s/Usage/usage/ for consistency.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@103955 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-09-25 07:26:25 +00:00
markm
b4c79417a1 From the requestor:
"Could you do me a favor and fix sys_bsd.c to get the howmany() macro
from <sys/param.h>, instead of <sys/types.h>?  This will save me from
having to worry about the unsync'd bits before making the change."

Requested by:	mike


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@103954 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-09-25 07:24:01 +00:00
alfred
0a0dabb57b 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)


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@96385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-05-11 03:19:44 +00:00
jkh
0dcd34090c Don't assume that the number of fds to select on is known quantity (in
this case 16).  Use dynamic FD_SETs and calculated high-water marks
throughout.  There are also too many versions of telnet in the tree.

Obtained from:  OpenBSD and Apple's Radar database
MFC after:      2 days


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87558 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-12-09 09:53:27 +00:00
jhay
0b3113dc49 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-12-03 17:42:02 +00:00
markm
0efd3a3530 help the alphas out with the WARNS=2 stuff.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-12-03 12:13:18 +00:00
markm
a88d48b9df Damn. The previous mega-commit was incomplete WRT ANSIfication. This
fixes that.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-11-30 22:28:07 +00:00
markm
820d180830 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.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-11-30 21:06:38 +00:00
markm
3efb267b2d Manually unifdef(1) CRAY, UNICOS, hpux and sun uselsess code.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@82497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-08-29 14:16:17 +00:00
markm
0fd2377dcc 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.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@81965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-08-20 12:28:40 +00:00
horikawa
65d4fa535a Removal of following export controll related sentences:
o Because of export controls, TELNET ENCRYPT option is not supported outside
  of the United States and Canada.
o Because of export controls, data encryption
  is not supported outside of the United States and Canada.

src/crypto/README revision 1.5 commit log says:
> Crypto sources are no longer export controlled:
> Explain, why crypto sources are still in crypto/.
and actually telnet encryption is used outside of US and Canada now.

Pointed out by: OHSAWA Chitoshi <ohsawa@catv1.ccn-net.ne.jp>
Reviewed by: no objection on doc


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@81665 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-08-15 01:30:25 +00:00
ru
bcdf745b83 mdoc(7) police: removed HISTORY info from the .Os call.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@79528 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-10 10:42:19 +00:00
ru
af631c25e4 mdoc(7) police: merge all fixes from non-crypto version.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@79324 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-05 14:08:12 +00:00
ru
6024787790 MF non-crypto: 1.13: document -u in usage.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@79323 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-05 14:06:27 +00:00
dillon
508568b464 Oops, forgot the 'u' in the getopt for the previous commit.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@77105 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-05-24 00:14:19 +00:00
dillon
c5ebb16d3c 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>


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@77095 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-05-23 22:54:07 +00:00
peter
b33b21628e Back out last commit. This was already fixed. This should never have
happened, this is why we have commit mail expressly delivered to
committers.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@76712 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-05-17 03:14:42 +00:00
nsayer
7005445e10 Since the root-on-insecure-tty code was added to telnetd, a dependency
on char *line was added to libtelnet. Put a dummy one in to keep the
linker happy.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@76697 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-05-16 20:34:42 +00:00
peter
8e7393fb93 Hack to work around braindeath in libtelnet:sra.c. The sra.o file
references global variables from telnetd, but is also linked into
telnet as well. I was tempted to back out the last sra.c change
as it is 100% bogus and should be taken out and shot, but for now
this bandaid should get world working again. :-(


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@76616 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-05-15 09:52:03 +00:00