summaryrefslogtreecommitdiffstats
path: root/contrib/telnet
diff options
context:
space:
mode:
authoruhclem <uhclem@FreeBSD.org>1997-10-08 03:14:34 +0000
committeruhclem <uhclem@FreeBSD.org>1997-10-08 03:14:34 +0000
commite9a0f249e77be3f3814005f2a78e6174a7d42372 (patch)
tree6ec7bec4107d5bc9869e8c317df9115668197879 /contrib/telnet
parenta278a3be1699411f887125d58dafc5acb30a146f (diff)
downloadFreeBSD-src-e9a0f249e77be3f3814005f2a78e6174a7d42372.zip
FreeBSD-src-e9a0f249e77be3f3814005f2a78e6174a7d42372.tar.gz
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.
Diffstat (limited to 'contrib/telnet')
-rw-r--r--contrib/telnet/telnetd/telnetd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c
index 6e09ab4..805047d 100644
--- a/contrib/telnet/telnetd/telnetd.c
+++ b/contrib/telnet/telnetd/telnetd.c
@@ -192,6 +192,22 @@ main(argc, argv)
progname = *argv;
+ /*
+ * This initialization causes linemode to default to a configuration
+ * that works on all telnet clients, including the FreeBSD client.
+ * This is not quite the same as the telnet client issuing a "mode
+ * character" command, but has most of the same benefits, and is
+ * preferable since some clients (like usofts) don't have the
+ * mode character command anyway and linemode breaks things.
+ * The most notable symptom of fix is that csh "set filec" operations
+ * like <ESC> (filename completion) and ^D (choices) keys now work
+ * in telnet sessions and can be used more than once on the same line.
+ * CR/LF handling is also corrected in some termio modes. This
+ * change resolves problem reports bin/771 and bin/1037.
+ */
+
+ linemode=1; /*Default to mode that works on bulk of clients*/
+
#ifdef CRAY
/*
* Get number of pty's before trying to process options,
OpenPOWER on IntegriCloud