summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/appl/telnet
diff options
context:
space:
mode:
authorassar <assar@FreeBSD.org>2001-06-21 02:12:07 +0000
committerassar <assar@FreeBSD.org>2001-06-21 02:12:07 +0000
commit7281f9682138be213c08fe4674685b925aef5ead (patch)
tree8db65324ee035fc0568492b88eec17f660241fd0 /crypto/heimdal/appl/telnet
parent869b11442ded05e5e48acc47ea0896d83d8ea198 (diff)
parent0c8fa354358381b3f1b92598e7f1b46f8cf744cc (diff)
downloadFreeBSD-src-7281f9682138be213c08fe4674685b925aef5ead.zip
FreeBSD-src-7281f9682138be213c08fe4674685b925aef5ead.tar.gz
This commit was generated by cvs2svn to compensate for changes in r78527,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/heimdal/appl/telnet')
-rw-r--r--crypto/heimdal/appl/telnet/ChangeLog36
-rw-r--r--crypto/heimdal/appl/telnet/Makefile.in30
-rw-r--r--crypto/heimdal/appl/telnet/libtelnet/Makefile.in16
-rw-r--r--crypto/heimdal/appl/telnet/libtelnet/enc_des.c8
-rw-r--r--crypto/heimdal/appl/telnet/libtelnet/encrypt.h9
-rw-r--r--crypto/heimdal/appl/telnet/libtelnet/kerberos.c3
-rw-r--r--crypto/heimdal/appl/telnet/libtelnet/krb4encpwd.c3
-rw-r--r--crypto/heimdal/appl/telnet/telnet/Makefile.am3
-rw-r--r--crypto/heimdal/appl/telnet/telnet/Makefile.in33
-rw-r--r--crypto/heimdal/appl/telnet/telnet/commands.c10
-rw-r--r--crypto/heimdal/appl/telnet/telnet/externs.h9
-rw-r--r--crypto/heimdal/appl/telnet/telnet/sys_bsd.c5
-rw-r--r--crypto/heimdal/appl/telnet/telnet/telnet.cat1718
-rw-r--r--crypto/heimdal/appl/telnet/telnet/terminal.c6
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/Makefile.am3
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/Makefile.in33
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/ext.h9
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/sys_term.c23
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/telnetd.c65
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/telnetd.cat8297
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/telnetd.h1
-rw-r--r--crypto/heimdal/appl/telnet/telnetd/utility.c12
22 files changed, 1225 insertions, 107 deletions
diff --git a/crypto/heimdal/appl/telnet/ChangeLog b/crypto/heimdal/appl/telnet/ChangeLog
index 6857151..147066a 100644
--- a/crypto/heimdal/appl/telnet/ChangeLog
+++ b/crypto/heimdal/appl/telnet/ChangeLog
@@ -1,3 +1,36 @@
+2001-04-25 Assar Westerlund <assar@sics.se>
+
+ * telnetd/sys_term.c (start_login): give the correct error if exec
+ fails
+ * telnetd/utility.c (fatalperror_errno): add a new function with
+ explicit errno parameter
+
+2001-03-07 Assar Westerlund <assar@sics.se>
+
+ * telnetd/sys_term.c: some minimal more amount of
+ const-correctness
+
+2001-02-24 Assar Westerlund <assar@sics.se>
+
+ * libtelnet/enc_des.c: learn to live with libcrypto (from openssl)
+
+2001-02-20 Assar Westerlund <assar@sics.se>
+
+ * telnet/commands.c (tn): copy the hostname so it doesn't get
+ overwritten while reading ~/.telnetrc
+ (*): removed some unneeded externs
+
+2001-02-08 Assar Westerlund <assar@sics.se>
+
+ * telnetd/sys_term.c (startslave, start_login): re-write code to
+ keep track both of remote hostname and utmp string to be used
+ * telnetd/telnetd.c (doit, my_telnet): re-write code to keep track
+ both of remote hostname and utmp string to be used
+
+2001-02-07 Assar Westerlund <assar@sics.se>
+
+ * telnet/Makefile.am, telnetd/Makefile.am: add LIB_kdfs
+
2001-01-09 Assar Westerlund <assar@sics.se>
* libtelnet/kerberos5.c (kerberos5_is): use krb5_rd_cred2 instead
@@ -21,6 +54,9 @@
2000-12-07 Assar Westerlund <assar@sics.se>
+ * telnetd/telnetd.h: move include files around to avoid getting SE
+ from sys/*.h on HP to override SE from telnet.h
+
* telnetd/sys_term.c (scrub_env): remove some const-ness
* telnetd/sys_term.c (scrub_env): add LOGNAME and POSIXLY_CORRECT
to the list of authorized environment variables to be compatible
diff --git a/crypto/heimdal/appl/telnet/Makefile.in b/crypto/heimdal/appl/telnet/Makefile.in
index ad4a164..8a24b8b 100644
--- a/crypto/heimdal/appl/telnet/Makefile.in
+++ b/crypto/heimdal/appl/telnet/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.4b from Makefile.am
-# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -119,7 +120,7 @@ install_sh = @install_sh@
# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $
-# $Id: Makefile.am.common,v 1.23 2000/12/05 09:11:09 joda Exp $
+# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $
AUTOMAKE_OPTIONS = foreign no-dependencies
@@ -185,6 +186,8 @@ NROFF_MAN = groff -mandoc -Tascii
@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
@KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la
+@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la
+
CHECK_LOCAL = $(PROGRAMS)
SUBDIRS = libtelnet telnet telnetd
@@ -207,9 +210,10 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+DIST_SUBDIRS = $(SUBDIRS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .et .h .x
+.SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common
cd $(top_srcdir) && $(AUTOMAKE) --foreign appl/telnet/Makefile
@@ -250,11 +254,16 @@ mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
- rev="$$subdir $$rev"; \
- if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
done; \
- test "$$dot_seen" = "no" && rev=". $$rev"; \
+ rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
@@ -300,6 +309,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $$here
+
mostlyclean-tags:
clean-tags:
diff --git a/crypto/heimdal/appl/telnet/libtelnet/Makefile.in b/crypto/heimdal/appl/telnet/libtelnet/Makefile.in
index a43a6d5..efa9ad1 100644
--- a/crypto/heimdal/appl/telnet/libtelnet/Makefile.in
+++ b/crypto/heimdal/appl/telnet/libtelnet/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.4b from Makefile.am
-# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -119,7 +120,7 @@ install_sh = @install_sh@
# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $
-# $Id: Makefile.am.common,v 1.23 2000/12/05 09:11:09 joda Exp $
+# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $
AUTOMAKE_OPTIONS = foreign no-dependencies
@@ -185,6 +186,8 @@ NROFF_MAN = groff -mandoc -Tascii
@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
@KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la
+@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la
+
CHECK_LOCAL = $(PROGRAMS)
noinst_LIBRARIES = libtelnet.a
@@ -245,7 +248,7 @@ OBJECTS = $(am_libtelnet_a_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .1 .3 .5 .8 .c .cat1 .cat3 .cat5 .cat8 .et .h .lo .o .obj .x
+.SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .lo .o .obj
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common
cd $(top_srcdir) && $(AUTOMAKE) --foreign appl/telnet/libtelnet/Makefile
@@ -319,6 +322,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $$here
+
mostlyclean-tags:
clean-tags:
diff --git a/crypto/heimdal/appl/telnet/libtelnet/enc_des.c b/crypto/heimdal/appl/telnet/libtelnet/enc_des.c
index a24bfa7..a847138 100644
--- a/crypto/heimdal/appl/telnet/libtelnet/enc_des.c
+++ b/crypto/heimdal/appl/telnet/libtelnet/enc_des.c
@@ -33,7 +33,7 @@
#include <config.h>
-RCSID("$Id: enc_des.c,v 1.16 1998/07/09 23:16:23 assar Exp $");
+RCSID("$Id: enc_des.c,v 1.18 2001/02/24 05:47:39 assar Exp $");
#if defined(AUTHENTICATION) && defined(ENCRYPTION) && defined(DES_ENCRYPTION)
#include <arpa/telnet.h>
@@ -50,7 +50,11 @@ RCSID("$Id: enc_des.c,v 1.16 1998/07/09 23:16:23 assar Exp $");
#include "encrypt.h"
#include "misc-proto.h"
+#ifdef HAVE_OPENSSL_DES_H
+#include <openssl/des.h>
+#else
#include <des.h>
+#endif
extern int encrypt_debug_mode;
@@ -404,7 +408,7 @@ static void fb64_session(Session_Key *key, int server, struct fb *fbp)
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]);
if (fbp->once == 0) {
-#ifndef OLD_DES_RANDOM_KEY
+#if !defined(OLD_DES_RANDOM_KEY) && !defined(HAVE_OPENSSL_DES_H)
des_init_random_number_generator(&fbp->krbdes_key);
#endif
fbp->once = 1;
diff --git a/crypto/heimdal/appl/telnet/libtelnet/encrypt.h b/crypto/heimdal/appl/telnet/libtelnet/encrypt.h
index 5919db5..7bc69db 100644
--- a/crypto/heimdal/appl/telnet/libtelnet/encrypt.h
+++ b/crypto/heimdal/appl/telnet/libtelnet/encrypt.h
@@ -55,7 +55,7 @@
* or implied warranty.
*/
-/* $Id: encrypt.h,v 1.4 1997/01/24 23:10:56 assar Exp $ */
+/* $Id: encrypt.h,v 1.6 2001/02/15 06:46:28 assar Exp $ */
#ifndef __ENCRYPT__
#define __ENCRYPT__
@@ -90,6 +90,13 @@ typedef struct {
#define SK_DES 1 /* Matched Kerberos v5 KEYTYPE_DES */
+#ifdef HAVE_OPENSSL_DES_H
+#include <openssl/des.h>
+#define des_new_random_key des_random_key
+#else
+#include <des.h>
+#endif
+
#include "enc-proto.h"
extern int encrypt_debug_mode;
diff --git a/crypto/heimdal/appl/telnet/libtelnet/kerberos.c b/crypto/heimdal/appl/telnet/libtelnet/kerberos.c
index a003007..ea5a51e 100644
--- a/crypto/heimdal/appl/telnet/libtelnet/kerberos.c
+++ b/crypto/heimdal/appl/telnet/libtelnet/kerberos.c
@@ -55,7 +55,7 @@
#include <config.h>
#endif
-RCSID("$Id: kerberos.c,v 1.50 2000/11/23 02:28:06 joda Exp $");
+RCSID("$Id: kerberos.c,v 1.51 2001/02/15 04:20:52 assar Exp $");
#ifdef KRB4
#ifdef HAVE_SYS_TYPES_H
@@ -65,7 +65,6 @@ RCSID("$Id: kerberos.c,v 1.50 2000/11/23 02:28:06 joda Exp $");
#include <arpa/telnet.h>
#endif
#include <stdio.h>
-#include <des.h> /* BSD wont include this in krb.h, so we do it here */
#include <krb.h>
#include <pwd.h>
#include <stdlib.h>
diff --git a/crypto/heimdal/appl/telnet/libtelnet/krb4encpwd.c b/crypto/heimdal/appl/telnet/libtelnet/krb4encpwd.c
index a85d562c..0a4ff86 100644
--- a/crypto/heimdal/appl/telnet/libtelnet/krb4encpwd.c
+++ b/crypto/heimdal/appl/telnet/libtelnet/krb4encpwd.c
@@ -33,7 +33,7 @@
#include <config.h>
-RCSID("$Id: krb4encpwd.c,v 1.18 1999/09/16 20:41:34 assar Exp $");
+RCSID("$Id: krb4encpwd.c,v 1.19 2001/02/15 04:20:52 assar Exp $");
#ifdef KRB4_ENCPWD
/*
@@ -74,7 +74,6 @@ RCSID("$Id: krb4encpwd.c,v 1.18 1999/09/16 20:41:34 assar Exp $");
#include <pwd.h>
#include <stdio.h>
-#include <des.h>
#include <krb.h>
#include <stdlib.h>
#include <string.h>
diff --git a/crypto/heimdal/appl/telnet/telnet/Makefile.am b/crypto/heimdal/appl/telnet/telnet/Makefile.am
index 7dd9c19..3107850 100644
--- a/crypto/heimdal/appl/telnet/telnet/Makefile.am
+++ b/crypto/heimdal/appl/telnet/telnet/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.14 2000/11/15 22:51:11 assar Exp $
+# $Id: Makefile.am,v 1.15 2001/02/07 06:11:52 assar Exp $
include $(top_srcdir)/Makefile.am.common
@@ -19,4 +19,5 @@ LDADD = ../libtelnet/libtelnet.a \
$(LIB_krb4) \
$(LIB_des) \
$(LIB_tgetent) \
+ $(LIB_kdfs) \
$(LIB_roken)
diff --git a/crypto/heimdal/appl/telnet/telnet/Makefile.in b/crypto/heimdal/appl/telnet/telnet/Makefile.in
index 0a23fd9..02dedee 100644
--- a/crypto/heimdal/appl/telnet/telnet/Makefile.in
+++ b/crypto/heimdal/appl/telnet/telnet/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.4b from Makefile.am
-# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -113,13 +114,13 @@ dpagaix_CFLAGS = @dpagaix_CFLAGS@
dpagaix_LDADD = @dpagaix_LDADD@
install_sh = @install_sh@
-# $Id: Makefile.am,v 1.14 2000/11/15 22:51:11 assar Exp $
+# $Id: Makefile.am,v 1.15 2001/02/07 06:11:52 assar Exp $
# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $
-# $Id: Makefile.am.common,v 1.23 2000/12/05 09:11:09 joda Exp $
+# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $
AUTOMAKE_OPTIONS = foreign no-dependencies
@@ -185,6 +186,8 @@ NROFF_MAN = groff -mandoc -Tascii
@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
@KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la
+@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la
+
CHECK_LOCAL =
bin_PROGRAMS = telnet
@@ -201,6 +204,7 @@ LDADD = ../libtelnet/libtelnet.a \
$(LIB_krb4) \
$(LIB_des) \
$(LIB_tgetent) \
+ $(LIB_kdfs) \
$(LIB_roken)
subdir = appl/telnet/telnet
@@ -223,10 +227,16 @@ network.$(OBJEXT) ring.$(OBJEXT) sys_bsd.$(OBJEXT) telnet.$(OBJEXT) \
terminal.$(OBJEXT) utilities.$(OBJEXT)
telnet_OBJECTS = $(am_telnet_OBJECTS)
telnet_LDADD = $(LDADD)
-@KRB5_FALSE@telnet_DEPENDENCIES = ../libtelnet/libtelnet.a
-@KRB5_TRUE@telnet_DEPENDENCIES = ../libtelnet/libtelnet.a \
-@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \
-@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la
+@DCE_FALSE@@KRB5_FALSE@telnet_DEPENDENCIES = ../libtelnet/libtelnet.a
+@DCE_FALSE@@KRB5_TRUE@telnet_DEPENDENCIES = ../libtelnet/libtelnet.a \
+@DCE_FALSE@@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \
+@DCE_FALSE@@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la
+@DCE_TRUE@@KRB5_FALSE@telnet_DEPENDENCIES = ../libtelnet/libtelnet.a \
+@DCE_TRUE@@KRB5_FALSE@$(top_builddir)/lib/kdfs/libkdfs.la
+@DCE_TRUE@@KRB5_TRUE@telnet_DEPENDENCIES = ../libtelnet/libtelnet.a \
+@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \
+@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la \
+@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la
telnet_LDFLAGS =
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -248,7 +258,7 @@ OBJECTS = $(am_telnet_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .1 .3 .5 .8 .c .cat1 .cat3 .cat5 .cat8 .et .h .lo .o .obj .x
+.SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .lo .o .obj
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common
cd $(top_srcdir) && $(AUTOMAKE) --foreign appl/telnet/telnet/Makefile
@@ -381,6 +391,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $$here
+
mostlyclean-tags:
clean-tags:
diff --git a/crypto/heimdal/appl/telnet/telnet/commands.c b/crypto/heimdal/appl/telnet/telnet/commands.c
index 7d71979..9ddcfd9 100644
--- a/crypto/heimdal/appl/telnet/telnet/commands.c
+++ b/crypto/heimdal/appl/telnet/telnet/commands.c
@@ -33,7 +33,7 @@
#include "telnet_locl.h"
-RCSID("$Id: commands.c,v 1.64 2000/12/11 01:44:01 assar Exp $");
+RCSID("$Id: commands.c,v 1.65 2001/02/20 03:12:09 assar Exp $");
#if defined(IPPROTO_IP) && defined(IP_TOS)
int tos = -1;
@@ -988,7 +988,6 @@ unsetcmd(int argc, char *argv[])
* 'mode' command.
*/
#ifdef KLUDGELINEMODE
-extern int kludgelinemode;
static int
dokludgemode(void)
@@ -1030,7 +1029,6 @@ static int
dolmmode(int bit, int on)
{
unsigned char c;
- extern int linemode;
if (my_want_state_is_wont(TELOPT_LINEMODE)) {
printf("?Need to have LINEMODE option enabled first.\r\n");
@@ -1328,8 +1326,6 @@ shell(int argc, char **argv)
static int
bye(int argc, char **argv)
{
- extern int resettermname;
-
if (connected) {
shutdown(net, 2);
printf("Connection closed.\r\n");
@@ -1551,7 +1547,6 @@ env_find(unsigned char *var)
void
env_init(void)
{
- extern char **environ;
char **epp, *cp;
struct env_lst *ep;
@@ -1972,7 +1967,7 @@ status(int argc, char **argv)
/*
* Function that gets called when SIGINFO is received.
*/
-void
+RETSIGTYPE
ayt_status(int ignore)
{
call(status, "status", "notmuch", 0);
@@ -2117,6 +2112,7 @@ tn(int argc, char **argv)
goto usage;
strlcpy (_hostname, hostp, sizeof(_hostname));
+ hostp = _hostname;
if (hostp[0] == '@' || hostp[0] == '!') {
char *p;
hostname = NULL;
diff --git a/crypto/heimdal/appl/telnet/telnet/externs.h b/crypto/heimdal/appl/telnet/telnet/externs.h
index 10d8dcc..14337af 100644
--- a/crypto/heimdal/appl/telnet/telnet/externs.h
+++ b/crypto/heimdal/appl/telnet/telnet/externs.h
@@ -33,7 +33,7 @@
* @(#)externs.h 8.3 (Berkeley) 5/30/95
*/
-/* $Id: externs.h,v 1.20 2000/11/15 23:01:29 assar Exp $ */
+/* $Id: externs.h,v 1.21 2001/03/06 20:10:13 assar Exp $ */
#ifndef BSD
# define BSD 43
@@ -223,7 +223,7 @@ int EncryptStatus (void);
#endif
#ifdef SIGINFO
-void ayt_status(int);
+RETSIGTYPE ayt_status(int);
#endif
int tn(int argc, char **argv);
void command(int top, char *tbuf, int cnt);
@@ -428,3 +428,8 @@ extern Ring
ttyoring,
ttyiring;
+extern int resettermname;
+extern int linemode;
+#ifdef KLUDGELINEMODE
+extern int kludgelinemode;
+#endif
diff --git a/crypto/heimdal/appl/telnet/telnet/sys_bsd.c b/crypto/heimdal/appl/telnet/telnet/sys_bsd.c
index e47079e..9b3f9da 100644
--- a/crypto/heimdal/appl/telnet/telnet/sys_bsd.c
+++ b/crypto/heimdal/appl/telnet/telnet/sys_bsd.c
@@ -33,7 +33,7 @@
#include "telnet_locl.h"
-RCSID("$Id: sys_bsd.c,v 1.26 2000/10/19 21:19:57 assar Exp $");
+RCSID("$Id: sys_bsd.c,v 1.27 2001/03/06 20:10:14 assar Exp $");
/*
* The following routines try to encapsulate what is system dependent
@@ -118,9 +118,6 @@ TerminalAutoFlush(void)
#endif /* LNOFLSH */
}
-#ifdef KLUDGELINEMODE
-extern int kludgelinemode;
-#endif
/*
* TerminalSpecialChars()
*
diff --git a/crypto/heimdal/appl/telnet/telnet/telnet.cat1 b/crypto/heimdal/appl/telnet/telnet/telnet.cat1
new file mode 100644
index 0000000..708994e
--- /dev/null
+++ b/crypto/heimdal/appl/telnet/telnet/telnet.cat1
@@ -0,0 +1,718 @@
+
+TELNET(1) UNIX Reference Manual TELNET(1)
+
+NNAAMMEE
+ tteellnneett - user interface to the TELNET protocol
+
+SSYYNNOOPPSSIISS
+ tteellnneett [--7788EEFFKKLLaaccddffrrxx] [--SS _t_o_s] [--XX _a_u_t_h_t_y_p_e] [--ee _e_s_c_a_p_e_c_h_a_r] [--kk _r_e_a_l_m]
+ [--ll _u_s_e_r] [--nn _t_r_a_c_e_f_i_l_e] [_h_o_s_t [port]]
+
+DDEESSCCRRIIPPTTIIOONN
+ The tteellnneett command is used to communicate with another host using the
+ TELNET protocol. If tteellnneett is invoked without the _h_o_s_t argument, it en-
+ ters command mode, indicated by its prompt (tteellnneett>>). In this mode, it
+ accepts and executes the commands listed below. If it is invoked with
+ arguments, it performs an ooppeenn command with those arguments.
+
+ Options:
+
+ --88 Specifies an 8-bit data path. This causes an attempt to negoti-
+ ate the TELNET BINARY option on both input and output.
+
+ --77 Do not try to negotiate TELNET BINARY option.
+
+ --EE Stops any character from being recognized as an escape character.
+
+ --FF If Kerberos V5 authentication is being used, the --FF option allows
+ the local credentials to be forwarded to the remote system, in-
+ cluding any credentials that have already been forwarded into the
+ local environment.
+
+ --KK Specifies no automatic login to the remote system.
+
+ --LL Specifies an 8-bit data path on output. This causes the BINARY
+ option to be negotiated on output.
+
+ --SS _t_o_s Sets the IP type-of-service (TOS) option for the telnet connec-
+ tion to the value _t_o_s, which can be a numeric TOS value or, on
+ systems that support it, a symbolic TOS name found in the
+ /etc/iptos file.
+
+ --XX _a_t_y_p_e
+ Disables the _a_t_y_p_e type of authentication.
+
+ --aa Attempt automatic login. Currently, this sends the user name via
+ the USER variable of the ENVIRON option if supported by the re-
+ mote system. The name used is that of the current user as re-
+ turned by getlogin(2) if it agrees with the current user ID, oth-
+ erwise it is the name associated with the user ID.
+
+ --cc Disables the reading of the user's _._t_e_l_n_e_t_r_c file. (See the
+ ttooggggllee sskkiipprrcc command on this man page.)
+
+ --dd Sets the initial value of the ddeebbuugg toggle to TRUE
+
+ --ee _e_s_c_a_p_e _c_h_a_r
+ Sets the initial tteellnneett tteellnneett escape character to _e_s_c_a_p_e _c_h_a_r.
+ If _e_s_c_a_p_e _c_h_a_r is omitted, then there will be no escape charac-
+ ter.
+
+ --ff If Kerberos V5 authentication is being used, the --ff option allows
+ the local credentials to be forwarded to the remote system.
+
+ --kk _r_e_a_l_m
+ If Kerberos authentication is being used, the --kk option requests
+ that telnet obtain tickets for the remote host in realm realm in-
+ stead of the remote host's realm, as determined by
+ krb_realmofhost(3).
+
+ --ll _u_s_e_r
+ When connecting to the remote system, if the remote system under-
+ stands the ENVIRON option, then _u_s_e_r will be sent to the remote
+ system as the value for the variable USER. This option implies
+ the --aa option. This option may also be used with the ooppeenn com-
+ mand.
+
+ --nn _t_r_a_c_e_f_i_l_e
+ Opens _t_r_a_c_e_f_i_l_e for recording trace information. See the sseett
+ ttrraacceeffiillee command below.
+
+ --rr Specifies a user interface similar to rlogin(1). In this mode,
+ the escape character is set to the tilde (~) character, unless
+ modified by the -e option.
+
+ --xx Turns on encryption of the data stream if possible. This is cur-
+ rently the default and when it fails a warning is issued.
+
+ _h_o_s_t Indicates the official name, an alias, or the Internet address of
+ a remote host.
+
+ _p_o_r_t Indicates a port number (address of an application). If a number
+ is not specified, the default tteellnneett port is used.
+
+ When in rlogin mode, a line of the form ~. disconnects from the remote
+ host; ~ is the telnet escape character. Similarly, the line ~^Z suspends
+ the telnet session. The line ~^] escapes to the normal telnet escape
+ prompt.
+
+ Once a connection has been opened, tteellnneett will attempt to enable the
+ TELNET LINEMODE option. If this fails, then tteellnneett will revert to one of
+ two input modes: either ``character at a time'' or ``old line by line''
+ depending on what the remote system supports.
+
+ When LINEMODE is enabled, character processing is done on the local sys-
+ tem, under the control of the remote system. When input editing or char-
+ acter echoing is to be disabled, the remote system will relay that infor-
+ mation. The remote system will also relay changes to any special charac-
+ ters that happen on the remote system, so that they can take effect on
+ the local system.
+
+ In ``character at a time'' mode, most text typed is immediately sent to
+ the remote host for processing.
+
+ In ``old line by line'' mode, all text is echoed locally, and (normally)
+ only completed lines are sent to the remote host. The ``local echo char-
+ acter'' (initially ``^E'') may be used to turn off and on the local echo
+ (this would mostly be used to enter passwords without the password being
+ echoed).
+
+ If the LINEMODE option is enabled, or if the llooccaallcchhaarrss toggle is TRUE
+ (the default for ``old line by line``; see below), the user's qquuiitt, iinnttrr,
+ and fflluusshh characters are trapped locally, and sent as TELNET protocol se-
+ quences to the remote side. If LINEMODE has ever been enabled, then the
+ user's ssuusspp and eeooff are also sent as TELNET protocol sequences, and qquuiitt
+ is sent as a TELNET ABORT instead of BREAK There are options (see ttooggggllee
+ aauuttoofflluusshh and ttooggggllee aauuttoossyynncchh below) which cause this action to flush
+ subsequent output to the terminal (until the remote host acknowledges the
+ TELNET sequence) and flush previous terminal input (in the case of qquuiitt
+ and iinnttrr).
+
+
+ While connected to a remote host, tteellnneett command mode may be entered by
+ typing the tteellnneett ``escape character'' (initially ``^]''). When in com-
+ mand mode, the normal terminal editing conventions are available.
+
+ The following tteellnneett commands are available. Only enough of each command
+ to uniquely identify it need be typed (this is also true for arguments to
+ the mmooddee, sseett, ttooggggllee, uunnsseett, ssllcc, eennvviirroonn, and ddiissppllaayy commands).
+
+ aauutthh _a_r_g_u_m_e_n_t _._._.
+ The auth command manipulates the information sent through the
+ TELNET AUTHENTICATE option. Valid arguments for the auth com-
+ mand are as follows:
+
+ ddiissaabbllee _t_y_p_e Disables the specified type of authentication.
+ To obtain a list of available types, use the
+ aauutthh ddiissaabbllee ?? command.
+
+ eennaabbllee _t_y_p_e Enables the specified type of authentication.
+ To obtain a list of available types, use the
+ aauutthh eennaabbllee ?? command.
+
+ ssttaattuuss Lists the current status of the various types of
+ authentication.
+
+ cclloossee Close a TELNET session and return to command mode.
+
+ ddiissppllaayy _a_r_g_u_m_e_n_t _._._.
+ Displays all, or some, of the sseett and ttooggggllee values (see be-
+ low).
+
+ eennccrryypptt _a_r_g_u_m_e_n_t _._._.
+ The encrypt command manipulates the information sent through
+ the TELNET ENCRYPT option.
+
+ Note: Because of export controls, the TELNET ENCRYPT option
+ is not supported outside of the United States and Canada.
+
+ Valid arguments for the encrypt command are as follows:
+
+ ddiissaabbllee _t_y_p_e [iinnppuutt | oouuttppuutt]
+ Disables the specified type of encryption. If
+ you omit the input and output, both input and
+ output are disabled. To obtain a list of avail-
+ able types, use the eennccrryypptt ddiissaabbllee ?? command.
+
+ eennaabbllee _t_y_p_e [iinnppuutt | oouuttppuutt]
+ Enables the specified type of encryption. If
+ you omit input and output, both input and output
+ are enabled. To obtain a list of available
+ types, use the eennccrryypptt eennaabbllee ?? command.
+
+ iinnppuutt This is the same as the eennccrryypptt ssttaarrtt iinnppuutt com-
+ mand.
+
+ --iinnppuutt This is the same as the eennccrryypptt ssttoopp iinnppuutt com-
+ mand.
+
+ oouuttppuutt This is the same as the eennccrryypptt ssttaarrtt oouuttppuutt
+ command.
+
+ --oouuttppuutt This is the same as the eennccrryypptt ssttoopp oouuttppuutt com-
+ mand.
+
+ ssttaarrtt [iinnppuutt | oouuttppuutt]
+ Attempts to start encryption. If you omit iinnppuutt
+ and oouuttppuutt, both input and output are enabled.
+ To obtain a list of available types, use the
+ eennccrryypptt eennaabbllee ?? command.
+
+ ssttaattuuss Lists the current status of encryption.
+
+ ssttoopp [iinnppuutt | oouuttppuutt]
+ Stops encryption. If you omit input and output,
+ encryption is on both input and output.
+
+ ttyyppee _t_y_p_e Sets the default type of encryption to be used
+ with later eennccrryypptt ssttaarrtt or eennccrryypptt ssttoopp com-
+ mands.
+
+ eennvviirroonn _a_r_g_u_m_e_n_t_s _._._.
+ The eennvviirroonn command is used to manipulate the the variables
+ that my be sent through the TELNET ENVIRON option. The ini-
+ tial set of variables is taken from the users environment,
+ with only the DISPLAY and PRINTER variables being exported by
+ default. The USER variable is also exported if the --aa or --ll
+ options are used.
+
+ Valid arguments for the eennvviirroonn command are:
+
+ ddeeffiinnee _v_a_r_i_a_b_l_e _v_a_l_u_e
+ Define the variable _v_a_r_i_a_b_l_e to have a value of
+ _v_a_l_u_e. Any variables defined by this command are
+ automatically exported. The _v_a_l_u_e may be enclosed
+ in single or double quotes so that tabs and spaces
+ may be included.
+
+ uunnddeeffiinnee _v_a_r_i_a_b_l_e
+ Remove _v_a_r_i_a_b_l_e from the list of environment vari-
+ ables.
+
+ eexxppoorrtt _v_a_r_i_a_b_l_e
+ Mark the variable _v_a_r_i_a_b_l_e to be exported to the
+ remote side.
+
+ uunneexxppoorrtt _v_a_r_i_a_b_l_e
+ Mark the variable _v_a_r_i_a_b_l_e to not be exported un-
+ less explicitly asked for by the remote side.
+
+ lliisstt List the current set of environment variables.
+ Those marked with a ** will be sent automatically,
+ other variables will only be sent if explicitly
+ requested.
+
+ ?? Prints out help information for the eennvviirroonn com-
+ mand.
+
+ llooggoouutt Sends the TELNET LOGOUT option to the remote side. This com-
+ mand is similar to a cclloossee command; however, if the remote
+ side does not support the LOGOUT option, nothing happens. If,
+ however, the remote side does support the LOGOUT option, this
+ command should cause the remote side to close the TELNET con-
+ nection. If the remote side also supports the concept of sus-
+ pending a user's session for later reattachment, the logout
+ argument indicates that you should terminate the session imme-
+ diately.
+
+ mmooddee _t_y_p_e _T_y_p_e is one of several options, depending on the state of the
+ TELNET session. The remote host is asked for permission to go
+ into the requested mode. If the remote host is capable of en-
+ tering that mode, the requested mode will be entered.
+
+ cchhaarraacctteerr Disable the TELNET LINEMODE option, or, if the
+ remote side does not understand the LINEMODE op-
+ tion, then enter ``character at a time`` mode.
+
+ lliinnee Enable the TELNET LINEMODE option, or, if the
+ remote side does not understand the LINEMODE op-
+ tion, then attempt to enter ``old-line-by-line``
+ mode.
+
+ iissiigg (--iissiigg) Attempt to enable (disable) the TRAPSIG mode of
+ the LINEMODE option. This requires that the
+ LINEMODE option be enabled.
+
+ eeddiitt (--eeddiitt) Attempt to enable (disable) the EDIT mode of the
+ LINEMODE option. This requires that the
+ LINEMODE option be enabled.
+
+ ssooffttttaabbss (--ssooffttttaabbss)
+ Attempt to enable (disable) the SOFT_TAB mode of
+ the LINEMODE option. This requires that the
+ LINEMODE option be enabled.
+
+ lliitteecchhoo (--lliitteecchhoo)
+ Attempt to enable (disable) the LIT_ECHO mode of
+ the LINEMODE option. This requires that the
+ LINEMODE option be enabled.
+
+ ?? Prints out help information for the mmooddee com-
+ mand.
+
+ ooppeenn _h_o_s_t [--ll _u_s_e_r] [[--]_p_o_r_t]
+ Open a connection to the named host. If no port number is
+ specified, tteellnneett will attempt to contact a TELNET server at
+ the default port. The host specification may be either a host
+ name (see hosts(5)) or an Internet address specified in the
+ ``dot notation'' (see inet(3)). The [--ll] option may be used
+ to specify the user name to be passed to the remote system via
+ the ENVIRON option. When connecting to a non-standard port,
+ tteellnneett omits any automatic initiation of TELNET options. When
+ the port number is preceded by a minus sign, the initial op-
+ tion negotiation is done. After establishing a connection,
+ the file _._t_e_l_n_e_t_r_c in the users home directory is opened.
+ Lines beginning with a # are comment lines. Blank lines are
+ ignored. Lines that begin without white space are the start
+ of a machine entry. The first thing on the line is the name
+ of the machine that is being connected to. The rest of the
+ line, and successive lines that begin with white space are as-
+ sumed to be tteellnneett commands and are processed as if they had
+ been typed in manually to the tteellnneett command prompt.
+
+ qquuiitt Close any open TELNET session and exit tteellnneett. An end of file
+ (in command mode) will also close a session and exit.
+
+ sseenndd _a_r_g_u_m_e_n_t_s
+ Sends one or more special character sequences to the remote
+ host. The following are the arguments which may be specified
+ (more than one argument may be specified at a time):
+
+ aabboorrtt Sends the TELNET ABORT (Abort processes) sequence.
+
+ aaoo Sends the TELNET AO (Abort Output) sequence, which
+ should cause the remote system to flush all output
+ _f_r_o_m the remote system _t_o the user's terminal.
+
+ aayytt Sends the TELNET AYT (Are You There) sequence, to
+ which the remote system may or may not choose to re-
+
+ spond.
+
+ bbrrkk Sends the TELNET BRK (Break) sequence, which may have
+ significance to the remote system.
+
+ eecc Sends the TELNET EC (Erase Character) sequence, which
+ should cause the remote system to erase the last char-
+ acter entered.
+
+ eell Sends the TELNET EL (Erase Line) sequence, which
+ should cause the remote system to erase the line cur-
+ rently being entered.
+
+ eeooff Sends the TELNET EOF (End Of File) sequence.
+
+ eeoorr Sends the TELNET EOR (End of Record) sequence.
+
+ eessccaappee Sends the current tteellnneett escape character (initially
+ ``^'').
+
+ ggaa Sends the TELNET GA (Go Ahead) sequence, which likely
+ has no significance to the remote system.
+
+ ggeettssttaattuuss
+ If the remote side supports the TELNET STATUS command,
+ ggeettssttaattuuss will send the subnegotiation to request that
+ the server send its current option status.
+
+ iipp Sends the TELNET IP (Interrupt Process) sequence,
+ which should cause the remote system to abort the cur-
+ rently running process.
+
+ nnoopp Sends the TELNET NOP (No OPeration) sequence.
+
+ ssuusspp Sends the TELNET SUSP (SUSPend process) sequence.
+
+ ssyynncchh Sends the TELNET SYNCH sequence. This sequence causes
+ the remote system to discard all previously typed (but
+ not yet read) input. This sequence is sent as TCP ur-
+ gent data (and may not work if the remote system is a
+ 4.2BSD system -- if it doesn't work, a lower case
+ ``r'' may be echoed on the terminal).
+
+ ddoo _c_m_d
+
+ ddoonntt _c_m_d
+
+ wwiillll _c_m_d
+
+ wwoonntt _c_m_d
+ Sends the TELNET DO _c_m_d sequence. _C_m_d can be either a
+ decimal number between 0 and 255, or a symbolic name
+ for a specific TELNET command. _C_m_d can also be either
+ hheellpp or ?? to print out help information, including a
+ list of known symbolic names.
+
+ ?? Prints out help information for the sseenndd command.
+
+ sseett _a_r_g_u_m_e_n_t _v_a_l_u_e
+
+ uunnsseett _a_r_g_u_m_e_n_t _v_a_l_u_e
+ The sseett command will set any one of a number of tteellnneett vari-
+ ables to a specific value or to TRUE. The special value ooffff
+ turns off the function associated with the variable, this is
+ equivalent to using the uunnsseett command. The uunnsseett command will
+ disable or set to FALSE any of the specified functions. The
+ values of variables may be interrogated with the ddiissppllaayy com-
+ mand. The variables which may be set or unset, but not tog-
+ gled, are listed here. In addition, any of the variables for
+ the ttooggggllee command may be explicitly set or unset using the
+ sseett and uunnsseett commands.
+
+ aayytt If TELNET is in localchars mode, or LINEMODE is en-
+ abled, and the status character is typed, a TELNET AYT
+ sequence (see sseenndd aayytt preceding) is sent to the re-
+ mote host. The initial value for the "Are You There"
+ character is the terminal's status character.
+
+ eecchhoo This is the value (initially ``^E'') which, when in
+ ``line by line'' mode, toggles between doing local
+ echoing of entered characters (for normal processing),
+ and suppressing echoing of entered characters (for en-
+ tering, say, a password).
+
+ eeooff If tteellnneett is operating in LINEMODE or ``old line by
+ line'' mode, entering this character as the first
+ character on a line will cause this character to be
+ sent to the remote system. The initial value of the
+ eof character is taken to be the terminal's eeooff char-
+ acter.
+
+ eerraassee If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
+ below), aanndd if tteellnneett is operating in ``character at a
+ time'' mode, then when this character is typed, a
+ TELNET EC sequence (see sseenndd eecc above) is sent to the
+ remote system. The initial value for the erase char-
+ acter is taken to be the terminal's eerraassee character.
+
+ eessccaappee This is the tteellnneett escape character (initially ``^['')
+ which causes entry into tteellnneett command mode (when con-
+ nected to a remote system).
+
+ fflluusshhoouuttppuutt
+ If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
+ below) and the fflluusshhoouuttppuutt character is typed, a
+ TELNET AO sequence (see sseenndd aaoo above) is sent to the
+ remote host. The initial value for the flush charac-
+ ter is taken to be the terminal's fflluusshh character.
+
+ ffoorrww11
+
+ ffoorrww22 If TELNET is operating in LINEMODE, these are the
+ characters that, when typed, cause partial lines to be
+ forwarded to the remote system. The initial value for
+ the forwarding characters are taken from the termi-
+ nal's eol and eol2 characters.
+
+ iinntteerrrruupptt
+ If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
+ below) and the iinntteerrrruupptt character is typed, a TELNET
+ IP sequence (see sseenndd iipp above) is sent to the remote
+ host. The initial value for the interrupt character
+ is taken to be the terminal's iinnttrr character.
+
+ kkiillll If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
+ below), aanndd if tteellnneett is operating in ``character at a
+ time'' mode, then when this character is typed, a
+ TELNET EL sequence (see sseenndd eell above) is sent to the
+ remote system. The initial value for the kill charac-
+ ter is taken to be the terminal's kkiillll character.
+
+ llnneexxtt If tteellnneett is operating in LINEMODE or ``old line by
+ line`` mode, then this character is taken to be the
+ terminal's llnneexxtt character. The initial value for the
+ lnext character is taken to be the terminal's llnneexxtt
+ character.
+
+ qquuiitt If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
+ below) and the qquuiitt character is typed, a TELNET BRK
+ sequence (see sseenndd bbrrkk above) is sent to the remote
+ host. The initial value for the quit character is
+ taken to be the terminal's qquuiitt character.
+
+ rreepprriinntt
+ If tteellnneett is operating in LINEMODE or ``old line by
+ line`` mode, then this character is taken to be the
+ terminal's rreepprriinntt character. The initial value for
+ the reprint character is taken to be the terminal's
+ rreepprriinntt character.
+
+ rrllooggiinn This is the rlogin escape character. If set, the nor-
+ mal TELNET escape character is ignored unless it is
+ preceded by this character at the beginning of a line.
+ This character, at the beginning of a line followed by
+ a "." closes the connection; when followed by a ^Z it
+ suspends the telnet command. The initial state is to
+ disable the rlogin escape character.
+
+ ssttaarrtt If the TELNET TOGGLE-FLOW-CONTROL option has been en-
+ abled, then this character is taken to be the termi-
+ nal's ssttaarrtt character. The initial value for the kill
+ character is taken to be the terminal's ssttaarrtt charac-
+ ter.
+
+ ssttoopp If the TELNET TOGGLE-FLOW-CONTROL option has been en-
+ abled, then this character is taken to be the termi-
+ nal's ssttoopp character. The initial value for the kill
+ character is taken to be the terminal's ssttoopp charac-
+ ter.
+
+ ssuusspp If tteellnneett is in llooccaallcchhaarrss mode, or LINEMODE is en-
+ abled, and the ssuussppeenndd character is typed, a TELNET
+ SUSP sequence (see sseenndd ssuusspp above) is sent to the re-
+ mote host. The initial value for the suspend charac-
+ ter is taken to be the terminal's ssuussppeenndd character.
+
+ ttrraacceeffiillee
+ This is the file to which the output, caused by
+ nneettddaattaa or ooppttiioonn tracing being TRUE, will be written.
+ If it is set to ``--'', then tracing information will
+ be written to standard output (the default).
+
+ wwoorrddeerraassee
+ If tteellnneett is operating in LINEMODE or ``old line by
+ line`` mode, then this character is taken to be the
+ terminal's wwoorrddeerraassee character. The initial value for
+ the worderase character is taken to be the terminal's
+ wwoorrddeerraassee character.
+
+ ?? Displays the legal sseett (uunnsseett) commands.
+
+ ssllcc _s_t_a_t_e The ssllcc command (Set Local Characters) is used to set or
+ change the state of the the special characters when the TELNET
+ LINEMODE option has been enabled. Special characters are
+ characters that get mapped to TELNET commands sequences (like
+ iipp or qquuiitt) or line editing characters (like eerraassee and kkiillll).
+
+
+ By default, the local special characters are exported.
+
+ cchheecckk Verify the current settings for the current spe-
+ cial characters. The remote side is requested to
+ send all the current special character settings,
+ and if there are any discrepancies with the local
+ side, the local side will switch to the remote
+ value.
+
+ eexxppoorrtt Switch to the local defaults for the special char-
+ acters. The local default characters are those of
+ the local terminal at the time when tteellnneett was
+ started.
+
+ iimmppoorrtt Switch to the remote defaults for the special
+ characters. The remote default characters are
+ those of the remote system at the time when the
+ TELNET connection was established.
+
+ ?? Prints out help information for the ssllcc command.
+
+ ssttaattuuss Show the current status of tteellnneett. This includes the peer one
+ is connected to, as well as the current mode.
+
+ ttooggggllee _a_r_g_u_m_e_n_t_s _._._.
+ Toggle (between TRUE and FALSE) various flags that control how
+ tteellnneett responds to events. These flags may be set explicitly
+ to TRUE or FALSE using the sseett and uunnsseett commands listed
+ above. More than one argument may be specified. The state of
+ these flags may be interrogated with the ddiissppllaayy command.
+ Valid arguments are:
+
+ aauutthhddeebbuugg Turns on debugging information for the authenti-
+ cation code.
+
+ aauuttoofflluusshh If aauuttoofflluusshh and llooccaallcchhaarrss are both TRUE, then
+ when the aaoo, or qquuiitt characters are recognized
+ (and transformed into TELNET sequences; see sseett
+ above for details), tteellnneett refuses to display
+ any data on the user's terminal until the remote
+ system acknowledges (via a TELNET TIMING MARK
+ option) that it has processed those TELNET se-
+ quences. The initial value for this toggle is
+ TRUE if the terminal user had not done an "stty
+ noflsh", otherwise FALSE (see stty(1)).
+
+ aauuttooddeeccrryypptt When the TELNET ENCRYPT option is negotiated, by
+ default the actual encryption (decryption) of
+ the data stream does not start automatically.
+ The autoencrypt (autodecrypt) command states
+ that encryption of the output (input) stream
+ should be enabled as soon as possible.
+
+ Note: Because of export controls, the TELNET
+ ENCRYPT option is not supported outside the
+ United States and Canada.
+
+ aauuttoollooggiinn If the remote side supports the TELNET
+ AUTHENTICATION option TELNET attempts to use it
+ to perform automatic authentication. If the
+ AUTHENTICATION option is not supported, the us-
+ er's login name are propagated through the
+ TELNET ENVIRON option. This command is the same
+ as specifying _a option on the ooppeenn command.
+
+ aauuttoossyynncchh If aauuttoossyynncchh and llooccaallcchhaarrss are both TRUE, then
+ when either the iinnttrr or qquuiitt characters is typed
+ (see sseett above for descriptions of the iinnttrr and
+ qquuiitt characters), the resulting TELNET sequence
+ sent is followed by the TELNET SYNCH sequence.
+ This procedure sshhoouulldd cause the remote system to
+ begin throwing away all previously typed input
+ until both of the TELNET sequences have been
+ read and acted upon. The initial value of this
+ toggle is FALSE.
+
+ bbiinnaarryy Enable or disable the TELNET BINARY option on
+ both input and output.
+
+ iinnbbiinnaarryy Enable or disable the TELNET BINARY option on
+ input.
+
+ oouuttbbiinnaarryy Enable or disable the TELNET BINARY option on
+ output.
+
+ ccrrllff If this is TRUE, then carriage returns will be
+ sent as <CR><LF>. If this is FALSE, then car-
+ riage returns will be send as <CR><NUL>. The
+ initial value for this toggle is FALSE.
+
+ ccrrmmoodd Toggle carriage return mode. When this mode is
+ enabled, most carriage return characters re-
+ ceived from the remote host will be mapped into
+ a carriage return followed by a line feed. This
+ mode does not affect those characters typed by
+ the user, only those received from the remote
+ host. This mode is not very useful unless the
+ remote host only sends carriage return, but nev-
+ er line feed. The initial value for this toggle
+ is FALSE.
+
+ ddeebbuugg Toggles socket level debugging (useful only to
+ the ssuuppeerr uusseerr). The initial value for this tog-
+ gle is FALSE.
+
+ eennccddeebbuugg Turns on debugging information for the encryp-
+ tion code.
+
+ llooccaallcchhaarrss If this is TRUE, then the fflluusshh, iinntteerrrruupptt,
+ qquuiitt, eerraassee, and kkiillll characters (see sseett above)
+ are recognized locally, and transformed into
+ (hopefully) appropriate TELNET control sequences
+ (respectively aaoo, iipp, bbrrkk, eecc, and eell; see sseenndd
+ above). The initial value for this toggle is
+ TRUE in ``old line by line'' mode, and FALSE in
+ ``character at a time'' mode. When the LINEMODE
+ option is enabled, the value of llooccaallcchhaarrss is
+ ignored, and assumed to always be TRUE. If
+ LINEMODE has ever been enabled, then qquuiitt is
+ sent as aabboorrtt, and eeooff and ssuussppeenndd are sent as
+ eeooff and ssuusspp, see sseenndd above).
+
+ nneettddaattaa Toggles the display of all network data (in hex-
+ adecimal format). The initial value for this
+ toggle is FALSE.
+
+ ooppttiioonnss Toggles the display of some internal tteellnneett pro-
+ tocol processing (having to do with TELNET op-
+ tions). The initial value for this toggle is
+ FALSE.
+
+ pprreettttyydduummpp When the nneettddaattaa toggle is enabled, if
+ pprreettttyydduummpp is enabled the output from the
+ nneettddaattaa command will be formatted in a more user
+ readable format. Spaces are put between each
+ character in the output, and the beginning of
+ any TELNET escape sequence is preceded by a '*'
+ to aid in locating them.
+
+ sskkiipprrcc When the skiprc toggle is TRUE, TELNET skips the
+ reading of the _._t_e_l_n_e_t_r_c file in the users home
+ directory when connections are opened. The ini-
+ tial value for this toggle is FALSE.
+
+ tteerrmmddaattaa Toggles the display of all terminal data (in
+ hexadecimal format). The initial value for this
+ toggle is FALSE.
+
+ vveerrbboossee__eennccrryypptt
+ When the vveerrbboossee__eennccrryypptt toggle is TRUE, TELNET
+ prints out a message each time encryption is en-
+ abled or disabled. The initial value for this
+ toggle is FALSE. Note: Because of export con-
+ trols, data encryption is not supported outside
+ of the United States and Canada.
+
+ ?? Displays the legal ttooggggllee commands.
+
+ zz Suspend tteellnneett. This command only works when the user is using
+ the csh(1).
+
+ !! [_c_o_m_m_a_n_d]
+ Execute a single command in a subshell on the local system.
+ If ccoommmmaanndd is omitted, then an interactive subshell is in-
+ voked.
+
+ ?? [_c_o_m_m_a_n_d]
+ Get help. With no arguments, tteellnneett prints a help summary.
+ If a command is specified, tteellnneett will print the help informa-
+ tion for just that command.
+
+EENNVVIIRROONNMMEENNTT
+ TTeellnneett uses at least the HOME, SHELL, DISPLAY, and TERM environment vari-
+ ables. Other environment variables may be propagated to the other side
+ via the TELNET ENVIRON option.
+
+FFIILLEESS
+ ~/.telnetrc user customized telnet startup values
+
+HHIISSTTOORRYY
+ The TTeellnneett command appeared in 4.2BSD.
+
+NNOOTTEESS
+ On some remote systems, echo has to be turned off manually when in ``old
+ line by line'' mode.
+
+ In ``old line by line'' mode or LINEMODE the terminal's eeooff character is
+ only recognized (and sent to the remote system) when it is the first
+ character on a line.
+
+4.2 Berkeley Distribution June 1, 1994 11
diff --git a/crypto/heimdal/appl/telnet/telnet/terminal.c b/crypto/heimdal/appl/telnet/telnet/terminal.c
index 4404384..44e1611 100644
--- a/crypto/heimdal/appl/telnet/telnet/terminal.c
+++ b/crypto/heimdal/appl/telnet/telnet/terminal.c
@@ -33,7 +33,7 @@
#include "telnet_locl.h"
-RCSID("$Id: terminal.c,v 1.10 1997/12/15 19:53:06 joda Exp $");
+RCSID("$Id: terminal.c,v 1.11 2001/03/06 20:10:14 assar Exp $");
Ring ttyoring, ttyiring;
unsigned char ttyobuf[2*BUFSIZ], ttyibuf[BUFSIZ];
@@ -151,11 +151,7 @@ ttyflush(int drop)
int
getconnmode(void)
{
- extern int linemode;
int mode = 0;
-#ifdef KLUDGELINEMODE
- extern int kludgelinemode;
-#endif
if (my_want_state_is_dont(TELOPT_ECHO))
mode |= MODE_ECHO;
diff --git a/crypto/heimdal/appl/telnet/telnetd/Makefile.am b/crypto/heimdal/appl/telnet/telnetd/Makefile.am
index d8497c3..c375a05 100644
--- a/crypto/heimdal/appl/telnet/telnetd/Makefile.am
+++ b/crypto/heimdal/appl/telnet/telnetd/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.14 2000/11/15 22:51:11 assar Exp $
+# $Id: Makefile.am,v 1.15 2001/02/07 06:12:02 assar Exp $
include $(top_srcdir)/Makefile.am.common
@@ -20,4 +20,5 @@ LDADD = \
$(LIB_des) \
$(LIB_tgetent) \
$(LIB_logwtmp) \
+ $(LIB_kdfs) \
$(LIB_roken)
diff --git a/crypto/heimdal/appl/telnet/telnetd/Makefile.in b/crypto/heimdal/appl/telnet/telnetd/Makefile.in
index 07ac35b..c62a8ba 100644
--- a/crypto/heimdal/appl/telnet/telnetd/Makefile.in
+++ b/crypto/heimdal/appl/telnet/telnetd/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.4b from Makefile.am
-# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -113,13 +114,13 @@ dpagaix_CFLAGS = @dpagaix_CFLAGS@
dpagaix_LDADD = @dpagaix_LDADD@
install_sh = @install_sh@
-# $Id: Makefile.am,v 1.14 2000/11/15 22:51:11 assar Exp $
+# $Id: Makefile.am,v 1.15 2001/02/07 06:12:02 assar Exp $
# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $
-# $Id: Makefile.am.common,v 1.23 2000/12/05 09:11:09 joda Exp $
+# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $
AUTOMAKE_OPTIONS = foreign no-dependencies
@@ -185,6 +186,8 @@ NROFF_MAN = groff -mandoc -Tascii
@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
@KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la
+@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la
+
CHECK_LOCAL =
libexec_PROGRAMS = telnetd
@@ -202,6 +205,7 @@ LDADD = \
$(LIB_des) \
$(LIB_tgetent) \
$(LIB_logwtmp) \
+ $(LIB_kdfs) \
$(LIB_roken)
subdir = appl/telnet/telnetd
@@ -224,10 +228,16 @@ termstat.$(OBJEXT) slc.$(OBJEXT) sys_term.$(OBJEXT) utility.$(OBJEXT) \
global.$(OBJEXT) authenc.$(OBJEXT)
telnetd_OBJECTS = $(am_telnetd_OBJECTS)
telnetd_LDADD = $(LDADD)
-@KRB5_FALSE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a
-@KRB5_TRUE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \
-@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \
-@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la
+@DCE_FALSE@@KRB5_FALSE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a
+@DCE_FALSE@@KRB5_TRUE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \
+@DCE_FALSE@@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \
+@DCE_FALSE@@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la
+@DCE_TRUE@@KRB5_FALSE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \
+@DCE_TRUE@@KRB5_FALSE@$(top_builddir)/lib/kdfs/libkdfs.la
+@DCE_TRUE@@KRB5_TRUE@telnetd_DEPENDENCIES = ../libtelnet/libtelnet.a \
+@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \
+@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/asn1/libasn1.la \
+@DCE_TRUE@@KRB5_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la
telnetd_LDFLAGS =
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -249,7 +259,7 @@ OBJECTS = $(am_telnetd_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .1 .3 .5 .8 .c .cat1 .cat3 .cat5 .cat8 .et .h .lo .o .obj .x
+.SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .lo .o .obj
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common
cd $(top_srcdir) && $(AUTOMAKE) --foreign appl/telnet/telnetd/Makefile
@@ -382,6 +392,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $$here
+
mostlyclean-tags:
clean-tags:
diff --git a/crypto/heimdal/appl/telnet/telnetd/ext.h b/crypto/heimdal/appl/telnet/telnetd/ext.h
index 4c122f8..1cba5b6 100644
--- a/crypto/heimdal/appl/telnet/telnetd/ext.h
+++ b/crypto/heimdal/appl/telnet/telnetd/ext.h
@@ -33,7 +33,7 @@
* @(#)ext.h 8.2 (Berkeley) 12/15/93
*/
-/* $Id: ext.h,v 1.20 2000/11/15 23:03:38 assar Exp $ */
+/* $Id: ext.h,v 1.22 2001/04/24 23:12:11 assar Exp $ */
#ifndef __EXT_H__
#define __EXT_H__
@@ -116,15 +116,15 @@ void tty_tspeed (int val);
void tty_rspeed (int val);
void getptyslave (void);
int cleanopen (char *line);
-void startslave (char *host, int autologin, char *autoname);
+void startslave (const char *host, const char *, int autologin, char *autoname);
void init_env (void);
-void start_login (char *host, int autologin, char *name);
+void start_login (const char *host, int autologin, char *name);
void cleanup (int sig);
int main (int argc, char **argv);
int getterminaltype (char *name, size_t);
void _gettermname (void);
int terminaltypeok (char *s);
-void my_telnet (int f, int p, char*, int, char*);
+void my_telnet (int f, int p, const char*, const char *, int, char*);
void interrupt (void);
void sendbrk (void);
void sendsusp (void);
@@ -141,6 +141,7 @@ void netflush (void);
void writenet (unsigned char *ptr, int len);
void fatal (int f, char *msg);
void fatalperror (int f, const char *msg);
+void fatalperror_errno (int f, const char *msg, int error);
void edithost (char *pat, char *host);
void putstr (char *s);
void putchr (int cc);
diff --git a/crypto/heimdal/appl/telnet/telnetd/sys_term.c b/crypto/heimdal/appl/telnet/telnetd/sys_term.c
index 7c529af..067f8da 100644
--- a/crypto/heimdal/appl/telnet/telnetd/sys_term.c
+++ b/crypto/heimdal/appl/telnet/telnetd/sys_term.c
@@ -33,7 +33,7 @@
#include "telnetd.h"
-RCSID("$Id: sys_term.c,v 1.97 2000/12/08 23:32:06 assar Exp $");
+RCSID("$Id: sys_term.c,v 1.100 2001/04/24 23:11:43 assar Exp $");
#if defined(_CRAY) || (defined(__hpux) && !defined(HAVE_UTMPX_H))
# define PARENT_DOES_UTMP
@@ -1110,7 +1110,8 @@ make_id (char *tty)
/* ARGSUSED */
void
-startslave(char *host, int autologin, char *autoname)
+startslave(const char *host, const char *utmp_host,
+ int autologin, char *autoname)
{
int i;
@@ -1158,7 +1159,7 @@ startslave(char *host, int autologin, char *autoname)
wtmp.ut_type = LOGIN_PROCESS;
wtmp.ut_pid = pid;
strncpy(wtmp.ut_user, "LOGIN", sizeof(wtmp.ut_user));
- strncpy(wtmp.ut_host, host, sizeof(wtmp.ut_host));
+ strncpy(wtmp.ut_host, utmp_host, sizeof(wtmp.ut_host));
strncpy(wtmp.ut_line, clean_ttyname(line), sizeof(wtmp.ut_line));
#ifdef HAVE_STRUCT_UTMP_UT_ID
strncpy(wtmp.ut_id, wtmp.ut_line + 3, sizeof(wtmp.ut_id));
@@ -1192,7 +1193,6 @@ extern char **environ;
void
init_env(void)
{
- extern char *getenv(const char *);
char **envp;
envp = envinit;
@@ -1259,10 +1259,10 @@ scrub_env(void)
struct arg_val {
int size;
int argc;
- char **argv;
+ const char **argv;
};
-static void addarg(struct arg_val*, char*);
+static void addarg(struct arg_val*, const char*);
/*
* start_login(host)
@@ -1272,10 +1272,11 @@ static void addarg(struct arg_val*, char*);
*/
void
-start_login(char *host, int autologin, char *name)
+start_login(const char *host, int autologin, char *name)
{
struct arg_val argv;
char *user;
+ int save_errno;
#ifdef HAVE_UTMPX_H
int pid = getpid();
@@ -1316,7 +1317,7 @@ start_login(char *host, int autologin, char *name)
/* init argv structure */
argv.size=0;
argv.argc=0;
- argv.argv=(char**)malloc(0); /*so we can call realloc later */
+ argv.argv=malloc(0); /*so we can call realloc later */
addarg(&argv, "login");
addarg(&argv, "-h");
addarg(&argv, host);
@@ -1371,14 +1372,14 @@ start_login(char *host, int autologin, char *name)
sleep(1);
execv(new_login, argv.argv);
-
+ save_errno = errno;
syslog(LOG_ERR, "%s: %m\n", new_login);
- fatalperror(net, new_login);
+ fatalperror_errno(net, new_login, save_errno);
/*NOTREACHED*/
}
static void
-addarg(struct arg_val *argv, char *val)
+addarg(struct arg_val *argv, const char *val)
{
if(argv->size <= argv->argc+1) {
argv->argv = realloc(argv->argv, sizeof(char*) * (argv->size + 10));
diff --git a/crypto/heimdal/appl/telnet/telnetd/telnetd.c b/crypto/heimdal/appl/telnet/telnetd/telnetd.c
index b788574..af63ce1 100644
--- a/crypto/heimdal/appl/telnet/telnetd/telnetd.c
+++ b/crypto/heimdal/appl/telnet/telnetd/telnetd.c
@@ -33,7 +33,7 @@
#include "telnetd.h"
-RCSID("$Id: telnetd.c,v 1.63 2000/10/08 13:32:28 assar Exp $");
+RCSID("$Id: telnetd.c,v 1.64 2001/02/08 16:06:27 assar Exp $");
#ifdef _SC_CRAY_SECURE_SYS
#include <sys/sysv.h>
@@ -289,9 +289,14 @@ main(int argc, char **argv)
#endif
break;
- case 'u':
- utmp_len = atoi(optarg);
+ case 'u': {
+ char *eptr;
+
+ utmp_len = strtol(optarg, &eptr, 0);
+ if (optarg == eptr)
+ fprintf(stderr, "telnetd: unknown utmp len (%s)\n", optarg);
break;
+ }
case 'U':
registerd_host_only = 1;
@@ -490,7 +495,6 @@ int
getterminaltype(char *name, size_t name_sz)
{
int retval = -1;
- void _gettermname();
settimer(baseline);
#ifdef AUTHENTICATION
@@ -629,7 +633,7 @@ getterminaltype(char *name, size_t name_sz)
} /* end of getterminaltype */
void
-_gettermname()
+_gettermname(void)
{
/*
* If the client turned off the option,
@@ -653,9 +657,9 @@ terminaltypeok(char *s)
}
-char *hostname;
char host_name[MaxHostNameLen];
char remote_host_name[MaxHostNameLen];
+char remote_utmp_name[MaxHostNameLen];
/*
* Get a pty, scan input lines.
@@ -663,12 +667,10 @@ char remote_host_name[MaxHostNameLen];
static void
doit(struct sockaddr *who, int who_len)
{
- char *host = NULL;
int level;
int ptynum;
char user_name[256];
int error;
- char host_addr[256];
/*
* Find an available pty to use.
@@ -693,43 +695,42 @@ doit(struct sockaddr *who, int who_len)
}
#endif /* _SC_CRAY_SECURE_SYS */
- error = getnameinfo_verified (who, who_len, host_addr, sizeof(host_addr),
+ error = getnameinfo_verified (who, who_len,
+ remote_host_name,
+ sizeof(remote_host_name),
NULL, 0,
registerd_host_only ? NI_NAMEREQD : 0);
if (error)
fatal(net, "Couldn't resolve your address into a host name.\r\n\
Please contact your net administrator");
- /*
- * We must make a copy because Kerberos is probably going
- * to also do a gethost* and overwrite the static data...
- */
- strlcpy(remote_host_name, host_addr, sizeof(remote_host_name));
- host = remote_host_name;
-
- /* XXX - should be k_gethostname? */
gethostname(host_name, sizeof (host_name));
- hostname = host_name;
+
+ strlcpy (remote_utmp_name, remote_host_name, sizeof(remote_utmp_name));
/* Only trim if too long (and possible) */
- if (strlen(remote_host_name) > abs(utmp_len)) {
+ if (strlen(remote_utmp_name) > utmp_len) {
char *domain = strchr(host_name, '.');
- char *p = strchr(remote_host_name, '.');
- if (domain && p && (strcmp(p, domain) == 0))
- *p = 0; /* remove domain part */
+ char *p = strchr(remote_utmp_name, '.');
+ if (domain != NULL && p != NULL && (strcmp(p, domain) == 0))
+ *p = '\0'; /* remove domain part */
}
-
/*
* If hostname still doesn't fit utmp, use ipaddr.
*/
- if (strlen(remote_host_name) > abs(utmp_len))
- strlcpy(remote_host_name,
- host_addr,
- sizeof(remote_host_name));
+ if (strlen(remote_utmp_name) > utmp_len) {
+ error = getnameinfo (who, who_len,
+ remote_utmp_name,
+ sizeof(remote_utmp_name),
+ NULL, 0,
+ NI_NUMERICHOST);
+ if (error)
+ fatal(net, "Couldn't get numeric address\r\n");
+ }
#ifdef AUTHENTICATION
- auth_encrypt_init(hostname, host, "TELNETD", 1);
+ auth_encrypt_init(host_name, remote_host_name, "TELNETD", 1);
#endif
init_env();
@@ -750,7 +751,8 @@ Please contact your net administrator");
#endif /* _SC_CRAY_SECURE_SYS */
/* begin server processing */
- my_telnet(net, ourpty, host, level, user_name);
+ my_telnet(net, ourpty, remote_host_name, remote_utmp_name,
+ level, user_name);
/*NOTREACHED*/
} /* end of doit */
@@ -777,7 +779,8 @@ show_issue(void)
* hand data to telnet receiver finite state machine.
*/
void
-my_telnet(int f, int p, char *host, int level, char *autoname)
+my_telnet(int f, int p, const char *host, const char *utmp_host,
+ int level, char *autoname)
{
int on = 1;
char *he;
@@ -960,7 +963,7 @@ my_telnet(int f, int p, char *host, int level, char *autoname)
indefinitely */
if(!startslave_called && (!encrypt_delay() || timeout > time(NULL))){
startslave_called = 1;
- startslave(host, level, autoname);
+ startslave(host, utmp_host, level, autoname);
}
if (ncc < 0 && pcc < 0)
diff --git a/crypto/heimdal/appl/telnet/telnetd/telnetd.cat8 b/crypto/heimdal/appl/telnet/telnetd/telnetd.cat8
new file mode 100644
index 0000000..988bf31
--- /dev/null
+++ b/crypto/heimdal/appl/telnet/telnetd/telnetd.cat8
@@ -0,0 +1,297 @@
+
+TELNETD(8) UNIX System Manager's Manual TELNETD(8)
+
+NNAAMMEE
+ tteellnneettdd - DARPA TELNET protocol server
+
+SSYYNNOOPPSSIISS
+ tteellnneettdd [--BBUUhhkkllnn] [--DD _d_e_b_u_g_m_o_d_e] [--SS _t_o_s] [--XX _a_u_t_h_t_y_p_e] [--aa _a_u_t_h_m_o_d_e]
+ [--rr_l_o_w_p_t_y_-_h_i_g_h_p_t_y] [--uu _l_e_n] [--ddeebbuugg] [--LL _/_b_i_n_/_l_o_g_i_n] [_p_o_r_t]
+
+DDEESSCCRRIIPPTTIIOONN
+ The tteellnneettdd command is a server which supports the DARPA standard TELNET
+ virtual terminal protocol. TTeellnneettdd is normally invoked by the internet
+ server (see inetd(8)) for requests to connect to the TELNET port as in-
+ dicated by the _/_e_t_c_/_s_e_r_v_i_c_e_s file (see services(5)). The --ddeebbuugg option
+ may be used to start up tteellnneettdd manually, instead of through inetd(8).
+ If started up this way, _p_o_r_t may be specified to run tteellnneettdd on an alter-
+ nate TCP port number.
+
+ The tteellnneettdd command accepts the following options:
+
+ --aa _a_u_t_h_m_o_d_e This option may be used for specifying what mode should be
+ used for authentication. Note that this option is only use-
+ ful if tteellnneettdd has been compiled with support for the
+ AUTHENTICATION option. There are several valid values for
+ _a_u_t_h_m_o_d_e:
+
+ debug Turns on authentication debugging code.
+
+ user Only allow connections when the remote user can pro-
+ vide valid authentication information to identify the
+ remote user, and is allowed access to the specified
+ account without providing a password.
+
+ valid Only allow connections when the remote user can pro-
+ vide valid authentication information to identify the
+ remote user. The login(1) command will provide any
+ additional user verification needed if the remote us-
+ er is not allowed automatic access to the specified
+ account.
+
+ other Only allow connections that supply some authentica-
+ tion information. This option is currently not sup-
+ ported by any of the existing authentication mecha-
+ nisms, and is thus the same as specifying --aa vvaalliidd.
+
+ otp Only allow authenticated connections (as with --aa
+ uusseerr) and also logins with one-time passwords (OTPs).
+ This option will call login with an option so that
+ only OTPs are accepted. The user can of course still
+ type secret information at the prompt.
+
+ none This is the default state. Authentication informa-
+ tion is not required. If no or insufficient authen-
+ tication information is provided, then the login(1)
+ program will provide the necessary user verification.
+
+ off This disables the authentication code. All user ver-
+ ification will happen through the login(1) program.
+
+ --BB Ignored.
+
+ --DD _d_e_b_u_g_m_o_d_e
+ This option may be used for debugging purposes. This allows
+ tteellnneettdd to print out debugging information to the connec-
+ tion, allowing the user to see what tteellnneettdd is doing. There
+ are several possible values for _d_e_b_u_g_m_o_d_e:
+
+ ooppttiioonnss Prints information about the negotiation of TELNET
+ options.
+
+ rreeppoorrtt Prints the ooppttiioonnss information, plus some addi-
+ tional information about what processing is going
+ on.
+
+ nneettddaattaa Displays the data stream received by tteellnneettdd.
+
+ ppttyyddaattaa Displays data written to the pty.
+
+ eexxeerrcciissee Has not been implemented yet.
+
+ --hh Disables the printing of host-specific information before
+ login has been completed.
+
+ --kk
+
+ --ll Ignored.
+
+ --nn Disable TCP keep-alives. Normally tteellnneettdd enables the TCP
+ keep-alive mechanism to probe connections that have been
+ idle for some period of time to determine if the client is
+ still there, so that idle connections from machines that
+ have crashed or can no longer be reached may be cleaned up.
+
+ --rr _l_o_w_p_t_y_-_h_i_g_h_p_t_y
+ This option is only enabled when tteellnneettdd is compiled for
+ UNICOS. It specifies an inclusive range of pseudo-terminal
+ devices to use. If the system has sysconf variable
+ _SC_CRAY_NPTY configured, the default pty search range is 0
+ to _SC_CRAY_NPTY; otherwise, the default range is 0 to 128.
+ Either _l_o_w_p_t_y or _h_i_g_h_p_t_y may be omitted to allow changing
+ either end of the search range. If _l_o_w_p_t_y is omitted, the -
+ character is still required so that tteellnneettdd can differenti-
+ ate _h_i_g_h_p_t_y from _l_o_w_p_t_y.
+
+ --SS _t_o_s
+
+ --uu _l_e_n This option is used to specify the size of the field in the
+ utmp structure that holds the remote host name. If the re-
+ solved host name is longer than _l_e_n, the dotted decimal val-
+ ue will be used instead. This allows hosts with very long
+ host names that overflow this field to still be uniquely
+ identified. Specifying --uu00 indicates that only dotted deci-
+ mal addresses should be put into the _u_t_m_p file.
+
+ --UU This option causes tteellnneettdd to refuse connections from ad-
+ dresses that cannot be mapped back into a symbolic name via
+ the gethostbyaddr(3) routine.
+
+ --XX _a_u_t_h_t_y_p_e This option is only valid if tteellnneettdd has been built with
+ support for the authentication option. It disables the use
+ of _a_u_t_h_t_y_p_e authentication, and can be used to temporarily
+ disable a specific authentication type without having to re-
+ compile tteellnneettdd.
+
+ --LL --ppaatthhnnaammee
+ Specify pathname to an alternative login program.
+
+ TTeellnneettdd operates by allocating a pseudo-terminal device (see pty(4)) for
+ a client, then creating a login process which has the slave side of the
+ pseudo-terminal as stdin, stdout and stderr. TTeellnneettdd manipulates the mas-
+ ter side of the pseudo-terminal, implementing the TELNET protocol and
+ passing characters between the remote client and the login process.
+
+ When a TELNET session is started up, tteellnneettdd sends TELNET options to the
+ client side indicating a willingness to do the following TELNET options,
+ which are described in more detail below:
+
+ DO AUTHENTICATION
+ WILL ENCRYPT
+ DO TERMINAL TYPE
+ DO TSPEED
+ DO XDISPLOC
+ DO NEW-ENVIRON
+ DO ENVIRON
+ WILL SUPPRESS GO AHEAD
+ DO ECHO
+ DO LINEMODE
+ DO NAWS
+ WILL STATUS
+ DO LFLOW
+ DO TIMING-MARK
+
+ The pseudo-terminal allocated to the client is configured to operate in
+ ``cooked'' mode, and with XTABS and CRMOD enabled (see tty(4)).
+
+ TTeellnneettdd has support for enabling locally the following TELNET options:
+
+ WILL ECHO When the LINEMODE option is enabled, a WILL ECHO or
+ WONT ECHO will be sent to the client to indicate the
+ current state of terminal echoing. When terminal echo
+ is not desired, a WILL ECHO is sent to indicate that
+ telnetd will take care of echoing any data that needs
+ to be echoed to the terminal, and then nothing is
+ echoed. When terminal echo is desired, a WONT ECHO is
+ sent to indicate that telnetd will not be doing any
+ terminal echoing, so the client should do any terminal
+ echoing that is needed.
+
+ WILL BINARY Indicates that the client is willing to send a 8 bits
+ of data, rather than the normal 7 bits of the Network
+ Virtual Terminal.
+
+ WILL SGA Indicates that it will not be sending IAC GA, go
+ ahead, commands.
+
+ WILL STATUS Indicates a willingness to send the client, upon re-
+ quest, of the current status of all TELNET options.
+
+ WILL TIMING-MARK Whenever a DO TIMING-MARK command is received, it is
+ always responded to with a WILL TIMING-MARK
+
+ WILL LOGOUT When a DO LOGOUT is received, a WILL LOGOUT is sent in
+ response, and the TELNET session is shut down.
+
+ WILL ENCRYPT Only sent if tteellnneettdd is compiled with support for data
+ encryption, and indicates a willingness to decrypt the
+ data stream.
+
+ TTeellnneettdd has support for enabling remotely the following TELNET options:
+
+ DO BINARY Sent to indicate that telnetd is willing to receive an
+ 8 bit data stream.
+
+ DO LFLOW Requests that the client handle flow control charac-
+
+
+ ters remotely.
+
+ DO ECHO This is not really supported, but is sent to identify
+ a 4.2BSD telnet(1) client, which will improperly re-
+ spond with WILL ECHO. If a WILL ECHO is received, a
+ DONT ECHO will be sent in response.
+
+ DO TERMINAL-TYPE Indicates a desire to be able to request the name of
+ the type of terminal that is attached to the client
+ side of the connection.
+
+ DO SGA Indicates that it does not need to receive IAC GA, the
+ go ahead command.
+
+ DO NAWS Requests that the client inform the server when the
+ window (display) size changes.
+
+ DO TERMINAL-SPEED Indicates a desire to be able to request information
+ about the speed of the serial line to which the client
+ is attached.
+
+ DO XDISPLOC Indicates a desire to be able to request the name of
+ the X windows display that is associated with the tel-
+ net client.
+
+ DO NEW-ENVIRON Indicates a desire to be able to request environment
+ variable information, as described in RFC 1572.
+
+ DO ENVIRON Indicates a desire to be able to request environment
+ variable information, as described in RFC 1408.
+
+ DO LINEMODE Only sent if tteellnneettdd is compiled with support for
+ linemode, and requests that the client do line by line
+ processing.
+
+ DO TIMING-MARK Only sent if tteellnneettdd is compiled with support for both
+ linemode and kludge linemode, and the client responded
+ with WONT LINEMODE. If the client responds with WILL
+ TM, the it is assumed that the client supports kludge
+ linemode. Note that the [--kk] option can be used to
+ disable this.
+
+ DO AUTHENTICATION Only sent if tteellnneettdd is compiled with support for au-
+ thentication, and indicates a willingness to receive
+ authentication information for automatic login.
+
+ DO ENCRYPT Only sent if tteellnneettdd is compiled with support for data
+ encryption, and indicates a willingness to decrypt the
+ data stream.
+
+EENNVVIIRROONNMMEENNTT
+FFIILLEESS
+ /etc/services
+ /etc/inittab (UNICOS systems only)
+ /etc/iptos (if supported)
+
+SSEEEE AALLSSOO
+ telnet(1), login(1)
+
+SSTTAANNDDAARRDDSS
+ RRFFCC--885544 TELNET PROTOCOL SPECIFICATION
+ RRFFCC--885555 TELNET OPTION SPECIFICATIONS
+ RRFFCC--885566 TELNET BINARY TRANSMISSION
+ RRFFCC--885577 TELNET ECHO OPTION
+
+
+ RRFFCC--885588 TELNET SUPPRESS GO AHEAD OPTION
+ RRFFCC--885599 TELNET STATUS OPTION
+ RRFFCC--886600 TELNET TIMING MARK OPTION
+ RRFFCC--886611 TELNET EXTENDED OPTIONS - LIST OPTION
+ RRFFCC--888855 TELNET END OF RECORD OPTION
+ RRFFCC--11007733 Telnet Window Size Option
+ RRFFCC--11007799 Telnet Terminal Speed Option
+ RRFFCC--11009911 Telnet Terminal-Type Option
+ RRFFCC--11009966 Telnet X Display Location Option
+ RRFFCC--11112233 Requirements for Internet Hosts -- Application and Support
+ RRFFCC--11118844 Telnet Linemode Option
+ RRFFCC--11337722 Telnet Remote Flow Control Option
+ RRFFCC--11441166 Telnet Authentication Option
+ RRFFCC--11441111 Telnet Authentication: Kerberos Version 4
+ RRFFCC--11441122 Telnet Authentication: SPX
+ RRFFCC--11557711 Telnet Environment Option Interoperability Issues
+ RRFFCC--11557722 Telnet Environment Option
+
+BBUUGGSS
+ Some TELNET commands are only partially implemented.
+
+ Because of bugs in the original 4.2 BSD telnet(1), tteellnneettdd performs some
+ dubious protocol exchanges to try to discover if the remote client is, in
+ fact, a 4.2 BSD telnet(1).
+
+ Binary mode has no common interpretation except between similar operating
+ systems (Unix in this case).
+
+ The terminal type name received from the remote client is converted to
+ lower case.
+
+ TTeellnneettdd never sends TELNET IAC GA (go ahead) commands.
+
+4.2 Berkeley Distribution June 1, 1994 5
diff --git a/crypto/heimdal/appl/telnet/telnetd/telnetd.h b/crypto/heimdal/appl/telnet/telnetd/telnetd.h
index fdda3d7..6504607 100644
--- a/crypto/heimdal/appl/telnet/telnetd/telnetd.h
+++ b/crypto/heimdal/appl/telnet/telnetd/telnetd.h
@@ -166,7 +166,6 @@ struct hostent *gethostbyname(const char *);
#endif
#ifdef KRB4
-#include <des.h>
#include <krb.h>
#endif
diff --git a/crypto/heimdal/appl/telnet/telnetd/utility.c b/crypto/heimdal/appl/telnet/telnetd/utility.c
index a2e542d..496152c 100644
--- a/crypto/heimdal/appl/telnet/telnetd/utility.c
+++ b/crypto/heimdal/appl/telnet/telnetd/utility.c
@@ -34,7 +34,7 @@
#define PRINTOPTIONS
#include "telnetd.h"
-RCSID("$Id: utility.c,v 1.23 2000/10/08 13:34:27 assar Exp $");
+RCSID("$Id: utility.c,v 1.25 2001/05/17 00:34:42 assar Exp $");
/*
* utility functions performing io related tasks
@@ -363,14 +363,20 @@ void fatal(int f, char *msg)
}
void
-fatalperror(int f, const char *msg)
+fatalperror_errno(int f, const char *msg, int error)
{
char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(errno));
+ snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(error));
fatal(f, buf);
}
+void
+fatalperror(int f, const char *msg)
+{
+ fatalperror_errno(f, msg, errno);
+}
+
char editedhost[32];
void edithost(char *pat, char *host)
OpenPOWER on IntegriCloud