Commit Graph

18 Commits

Author SHA1 Message Date
ed
7aa7324a8f Convert telnetd(8) to use posix_openpt(2).
Some time ago I got some reports MPSAFE TTY broke telnetd(8). Even
though it turned out to be a different problem within the TTY code, I
spotted a small issue with telnetd(8). Instead of allocating PTY's using
openpty(3) or posix_openpt(2), it used its own PTY allocation routine.
This means that telnetd(8) still uses /dev/ptyXX-style devices.

I've also increased the size of line[]. Even though 16 should be enough,
we already use 13 bytes ("/dev/pts/999", including '\0'). 32 bytes gives
us a little more freedom.

Also enable -DSTREAMSPTY. Otherwise telnetd(8) strips the PTY's pathname
to the latest slash instead of just removing "/dev/" (e.g. /dev/pts/0 ->
0, instead of pts/0).

Reviewed by:	rink


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@184935 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2008-11-13 19:05:27 +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
jmallett
e151b0ff25 Don't risk catching a signal while handling a signal for a dying child, as we
can then end up not properly clearing wtmp/utmp entries.

PR:		bin/37934
Submitted by:	Sandeep Kumar <skumar@juniper.net>
Reviewed by:	markm
MFC after:	2 weeks


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@97341 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-05-27 08:10:24 +00:00
sheldonh
48a0b67941 Don't use non-signal-safe functions (exit(3) in this case) in
signal handlers.  In this case, use _exit(2) instead, following
the call to shutdown(2).

This fixes rare telnetd hangs.

PR:		misc/33672
Submitted by:	Umesh Krishnaswamy <umesh@juniper.net>
MFC after:	1 month


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@90242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2002-02-05 15:20:02 +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
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
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
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
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
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
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