From 4e82cbd918b7b5eefc10a680bc346fd862da9850 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 7 Jun 2001 17:05:31 +0000 Subject: [PATCH] * ext.h: Remove unused prototype for start_slave() and replace with one for startslave(). * state.c: Add libtlnet/encrypt.h for missing prototypes. * sys_term.c: Add prototype for dup_tty(). Change getptyslave() from int to void. Cleanup an assignment in conditional warning. * telnetd.c: Include libtelnet/misc-proto.h. Declare return from terminaltypeok() and main() as int. * utility.c: Include libtelnet/auth.h and libtelnet/encrypt.h for prototypes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13286 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnetd/ChangeLog | 16 ++++++++++++++++ src/appl/telnet/telnetd/ext.h | 6 +----- src/appl/telnet/telnetd/state.c | 3 +++ src/appl/telnet/telnetd/sys_term.c | 8 ++++---- src/appl/telnet/telnetd/telnetd.c | 14 +++++++++++--- src/appl/telnet/telnetd/utility.c | 11 +++++++++-- 6 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index b9ba7eb1e..a63d55662 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,19 @@ +2001-06-07 Ezra Peisach + + * ext.h: Remove unused prototype for start_slave() and replace + with one for startslave(). + + * state.c: Add libtlnet/encrypt.h for missing prototypes. + + * sys_term.c: Add prototype for dup_tty(). Change getptyslave() + from int to void. Cleanup an assignment in conditional warning. + + * telnetd.c: Include libtelnet/misc-proto.h. Declare return from + terminaltypeok() and main() as int. + + * utility.c: Include libtelnet/auth.h and libtelnet/encrypt.h for + prototypes. + 2001-04-27 Ken Raeburn * telnetd.c (valid_opts): Note that 'w' takes a parameter. diff --git a/src/appl/telnet/telnetd/ext.h b/src/appl/telnet/telnetd/ext.h index 2ff53e3e3..8f879d351 100644 --- a/src/appl/telnet/telnetd/ext.h +++ b/src/appl/telnet/telnetd/ext.h @@ -141,11 +141,7 @@ extern void set_termbuf P((void)), start_login P((char *, int, char *)), start_slc P((int)), -#if defined(AUTHENTICATION) - start_slave P((char *)), -#else - start_slave P((char *, int, char *)), -#endif + startslave P((char *, int, char *)), suboption P((void)), telrcv P((void)), ttloop P((void)), diff --git a/src/appl/telnet/telnetd/state.c b/src/appl/telnet/telnetd/state.c index 33743e43e..66f2738cb 100644 --- a/src/appl/telnet/telnetd/state.c +++ b/src/appl/telnet/telnetd/state.c @@ -37,6 +37,9 @@ #if defined(AUTHENTICATION) #include #endif +#if defined(ENCRYPTION) +#include +#endif unsigned char doopt[] = { IAC, DO, '%', 'c', 0 }; unsigned char dont[] = { IAC, DONT, '%', 'c', 0 }; diff --git a/src/appl/telnet/telnetd/sys_term.c b/src/appl/telnet/telnetd/sys_term.c index b79209d57..18251b6ce 100644 --- a/src/appl/telnet/telnetd/sys_term.c +++ b/src/appl/telnet/telnetd/sys_term.c @@ -193,6 +193,8 @@ int ttyfd = -1; #define setpgrp(a,b) setpgrp() #endif +int dup_tty(int); + /* * init_termbuf() * copy_termbuf(cp) @@ -904,7 +906,7 @@ tty_isnewmap() * that is necessary. The return value is a file descriptor * for the slave side. */ - int +void getptyslave() { int t = -1; @@ -1188,7 +1190,7 @@ init_env() char **envp; envp = envinit; - if (*envp = getenv("TZ")) + if ((*envp = getenv("TZ"))) *envp++ -= 3; #if defined(CRAY) || defined(__hpux) else @@ -1213,11 +1215,9 @@ start_login(host, autologin, name) int autologin; char *name; { - register char *cp; register char **argv; char **addarg(); extern char *getenv(); - register int pid = getpid(); #ifdef SOLARIS char *term; diff --git a/src/appl/telnet/telnetd/telnetd.c b/src/appl/telnet/telnetd/telnetd.c index 39c1948ca..6e940f982 100644 --- a/src/appl/telnet/telnetd/telnetd.c +++ b/src/appl/telnet/telnetd/telnetd.c @@ -74,6 +74,7 @@ struct socket_security ss; # endif /* SO_SEC_MULTI */ #endif /* _SC_CRAY_SECURE_SYS */ + #ifdef KRB5 #include "krb5.h" #endif @@ -86,6 +87,9 @@ struct socket_security ss; #include #include #endif +#if defined(AUTHENTICATION) || defined(ENCRYPTION) +#include +#endif int registerd_host_only = 0; @@ -128,6 +132,7 @@ char ptyibuf2[BUFSIZ]; #endif /* ! STREAMPTY */ void doit P((struct sockaddr_in *)); +int terminaltypeok P((char *)); int hostinfo = 1; /* do we print login banner? */ @@ -206,6 +211,7 @@ get_default_IM() return banner; } +int main(argc, argv) int argc; char *argv[]; @@ -945,16 +951,18 @@ extern void telnet P((int, int, char *)); void doit(who) struct sockaddr_in *who; { - char *host, *inet_ntoa(); + char *inet_ntoa(); struct hostent *hp; int level; +#if defined(_SC_CRAY_SECURE_SYS) int ptynum; +#endif char user_name[256]; -long retval; + long retval; /* * Find an available pty to use. */ -pty_init(); + pty_init(); if ((retval = pty_getpty(&pty, line, 17)) != 0) { diff --git a/src/appl/telnet/telnetd/utility.c b/src/appl/telnet/telnetd/utility.c index 408c6f4ad..8b0dde0cb 100644 --- a/src/appl/telnet/telnetd/utility.c +++ b/src/appl/telnet/telnetd/utility.c @@ -40,6 +40,13 @@ #include #endif +#if defined(AUTHENTICATION) +#include +#endif +#ifdef ENCRYPTION +#include +#endif + /* * utility functions performing io related tasks */ @@ -1143,12 +1150,12 @@ printsub(direction, pointer, length) break; case ENCRYPT_ENC_KEYID: - sprintf(nfrontp, " ENC_KEYID", pointer[1]); + sprintf(nfrontp, " ENC_KEYID"); nfrontp += strlen(nfrontp); goto encommon; case ENCRYPT_DEC_KEYID: - sprintf(nfrontp, " DEC_KEYID", pointer[1]); + sprintf(nfrontp, " DEC_KEYID"); nfrontp += strlen(nfrontp); goto encommon; -- 2.26.2