Commit Graph

94 Commits

Author SHA1 Message Date
ru 415314d0f6 mdoc(7) police: remove -r from SYNOPSIS, sort -p in DESCRIPTION.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87882 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-12-14 14:41:07 +00:00
ru c166211dae Fixed bugs from previous revision.
Removed -s from SYNOPSIS and restored -S in DESCRIPTION.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-12-04 16:02:36 +00:00
markm ba361ec27c More help for alpha WARNS=2. This code is, erm, unusual. Anyone who
feels like rewriting it will meet no objection from me.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87267 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-12-03 12:16:40 +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
dd ee8be0d9e9 Remove description of an option that only applies to UNICOS < 7.0.
That define may still be present in the source, but I don't think
anyone has plans to try to use it.

Obtained from:	NetBSD


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@82326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-08-25 21:29:12 +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
ru 02129244b2 mdoc(7) police: s/BSD/.Bx/ where appropriate.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@81622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-08-14 10:01:54 +00:00
kris 9de6e7ba10 output_data(), output_datalen() and netflush() didn't actually guarantee
to do what they are supposed to: under some circumstances output data would
be truncated, or the buffer would not actually be flushed (possibly leading
to overflows when the caller assumes the operation succeeded).  Change the
semantics so that these functions ensure they complete the operation before
returning.

Comment out diagnostic code enabled by '-D reports' which causes an
infinite recursion and an eventual crash.

Patch developed with assistance from ru and assar.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@80224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-23 21:52:26 +00:00
ru 2c684cfa07 More potential buffer overflow fixes.
o Fixed `nfrontp' calculations in output_data().  If `remaining' is
  initially zero, it was possible for `nfrontp' to be decremented.

Noticed by:	dillon

o Replaced leaking writenet() with output_datalen():

:  * writenet
:  *
:  * Just a handy little function to write a bit of raw data to the net.
:  * It will force a transmit of the buffer if necessary
:  *
:  * arguments
:  *    ptr - A pointer to a character string to write
:  *    len - How many bytes to write
:  */
: 	void
: writenet(ptr, len)
: 	register unsigned char *ptr;
: 	register int len;
: {
: 	/* flush buffer if no room for new data) */
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 	if ((&netobuf[BUFSIZ] - nfrontp) < len) {
: 		/* if this fails, don't worry, buffer is a little big */
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 		netflush();
: 	}
:
: 	memmove(nfrontp, ptr, len);
: 	nfrontp += len;
:
: }  /* end of writenet */

What an irony!  :-)

o Optimized output_datalen() a bit.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@80038 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-20 12:02:30 +00:00
ru 819182e3f6 vsnprintf() can return a value larger than the buffer size.
Submitted by:	assar
Obtained from:	OpenBSD


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@79992 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-19 18:58:31 +00:00
ru b3fb8c9630 Fixed the exploitable remote buffer overflow.
Reported on:	bugtraq
Obtained from:	Heimdal, NetBSD
Reviewed by:	obrien, imp


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@79981 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-07-19 17:48:57 +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
asmodai ed8b315538 Synch: Add $FreeBSD$.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@72139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-02-07 21:58:16 +00:00
asmodai 47df13c3d8 Fix typo: seperate -> separate.
Seperate does not exist in the english language.

Submitted to look at by:	kris


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@72089 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-02-06 10:39:38 +00:00
asmodai 80f3e3bc78 Fix typo: wierd -> weird.
There is no such thing as wierd in the english language.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@72083 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-02-06 09:32:26 +00:00
ru aea25d194d mdoc(7) police: split punctuation characters + misc fixes.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@71899 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-02-01 17:12:45 +00:00
ru 9e4c977b52 Prepare for mdoc(7)NG.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@70890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2001-01-10 16:51:28 +00:00
assar 40b68302ee (scrub_env): change to only accept a listed set of variables,
including only non-filename contents for TERMCAP


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@69825 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-12-10 20:50:20 +00:00
asmodai fe910aa69a Add more environment variables to be filtered through scrub_env().
Synched from normal telnet.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@69389 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-11-30 13:14:54 +00:00
asmodai e84c612e39 String paranoia fix. Synched from normal telnet.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@69387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-11-30 13:10:01 +00:00
asmodai a352b628e8 String paranoia. Merged from regular telnet.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@69384 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-11-30 10:55:25 +00:00
kris 312e8003c1 Correct definition of MAXHOSTNAMELEN in ifdef'ed code.
Submitted by:	Edwin Groothuis <mavetju@chello.nl>
PR:		bin/22787


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@69223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-11-26 21:37:51 +00:00
ru eec40d7c66 mdoc(7) police: use the new features of the Nm macro.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@68965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-11-20 20:10:44 +00:00
ru 0ee5242ab6 Avoid use of direct troff requests in mdoc(7) manual pages.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@68575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-11-10 17:46:15 +00:00
peter 1448d0f1e3 Add missing $FreeBSD$ to files that are NOT still on vendor a branch.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@63248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-07-16 05:48:49 +00:00
markm 811772a718 Freefall/Internat diff reducer.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@57414 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-02-24 10:37:29 +00:00
shin 32ca7e751c 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


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@56668 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2000-01-27 09:28:38 +00:00
peter 1e75920e30 $Id$ -> $FreeBSD$
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@50479 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-08-28 01:35:59 +00:00
nsayer 95b971e484 According to Mark Murray, Makefiles do not belong here. I guess we're
going to have to figure something else out.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@49901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-08-16 18:59:05 +00:00
nsayer 0f2c0f75fe Add SRA authentication to src/crypto/telnet.
SRA does a Diffie-Hellmen exchange and then DES-encrypts the
authentication data. If the authentication is successful, it also
sets up a session key for DES encryption.

SRA was originally developed at Texas A&M University.

This code is probably export restricted (despite the fact that I
originally found it at a University in Germany).

SRA is not perfect. It is vulnerable to monkey-in-the-middle attacks
and does not use tremendously large DH constants (and thus an individual
exchange probably could be factored in a few days on modern CPU
horsepower). It does not, however, require any changes in user or
administrative behavior and foils session hijacking and sniffing.
The goal of this commit is that telnet and telnetd end up in the DES
distribution and that therefore an encrypted session telnet becomes
standard issue for FreeBSD.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@49887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-08-16 11:24:29 +00:00
brian ec2cbe8315 MF libexec/telnetd: Determine the host name using an array size of
MAXHOSTNAMELEN and call trimdomain() before implementing
                    the -u option.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@45493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-04-08 21:39:34 +00:00
brian e115c62597 MF libexec/telnetd: MAXHOSTNAMELEN & -u fixes.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@45428 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-04-07 10:17:24 +00:00
brian 8229e94407 Use realhostname().
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@45395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-04-06 23:35:21 +00:00
brian a483d5b52d MF src/libexec/telnetd: Verify the reverse DNS lookup
ala rlogind.
Suggested by: markm


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@45377 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1999-04-06 12:41:27 +00:00
peter 8808a173ed Old stuff laying around: Don't use getstr which can conflict with some
curses/termcap/terminfo implementations and causes recursion.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@41858 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1998-12-16 06:06:06 +00:00
peter a2726b72a6 Old stuff from a source tree: copy (verbatum) the code to expand the
%s/%m in the default /etc/gettytab.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@41856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1998-12-16 06:01:33 +00:00
gpalmer 5abbe24d1c Remove redundant decl. of time(). Causes problems on alpha
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@38728 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1998-09-01 15:17:28 +00:00
imp dabfba2c01 MFC: sprintf paranoia
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@32688 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1998-01-22 00:04:57 +00:00
charnier 4f7c22a987 MFC: no \n in syslog strings. Change -P to -p in flags. EOF -> -1. Use err(3).
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@31622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1997-12-08 07:41:13 +00:00
uhclem d16b9a5166 PR: bin/771 and bin/1037 are resolved by this change
This change changes the default handling of linemode so that older and/or
stupider telnet clients can still get wakeup characters like <ESC> and
<CTRL>D to work correctly multiple times on the same line, as in csh
"set filec" operations.   It also causes CR and LF characters to be read by
apps in certain terminal modes consistently, as opposed to returning
CR sometimes and LF sometimes, which broke existing apps.  The change
was shown to fix the problem demonstrated in the FreeBSD telnet client,
along with the telnet client in Solaris, SCO, Windows '95 & NT, DEC OSF,
NCSA, and others.

A similar change was incorporated in the non-crypto version of telnetd.

This resolves bin/771 and bin/1037.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@30212 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1997-10-08 03:14:34 +00:00
markm 6ba4d9bbdb Bring the FreeBSD changes to the virgin sources.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@29181 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1997-09-07 07:02:53 +00:00
markm 0e15f670a1 This commit was generated by cvs2svn to compensate for changes in r29088,
which included commits to RCS files with non-trunk default branches.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@29089 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
1997-09-04 06:11:16 +00:00