Update after merge
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3606 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -2069,7 +2069,7 @@ tn(int argc, char **argv)
|
|||||||
--argc; ++argv;
|
--argc; ++argv;
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
goto usage;
|
goto usage;
|
||||||
user = *argv++;
|
user = strdup(*argv++);
|
||||||
--argc;
|
--argc;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -56,6 +56,10 @@
|
|||||||
#include <bsdsetjmp.h>
|
#include <bsdsetjmp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -67,6 +71,10 @@
|
|||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_TERMIO_H
|
||||||
|
#include <sys/termio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -79,9 +87,6 @@
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -144,6 +149,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <roken.h>
|
#include <roken.h>
|
||||||
|
/* krb.h? */
|
||||||
|
|
||||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||||
#include <libtelnet/auth.h>
|
#include <libtelnet/auth.h>
|
||||||
|
@@ -126,7 +126,7 @@ int getterminaltype (char *name);
|
|||||||
void _gettermname (void);
|
void _gettermname (void);
|
||||||
int terminaltypeok (char *s);
|
int terminaltypeok (char *s);
|
||||||
void doit (struct sockaddr_in *who);
|
void doit (struct sockaddr_in *who);
|
||||||
void telnet (int f, int p);
|
void telnet (int f, int p, char*, int, char*);
|
||||||
void interrupt (void);
|
void interrupt (void);
|
||||||
void sendbrk (void);
|
void sendbrk (void);
|
||||||
void sendsusp (void);
|
void sendsusp (void);
|
||||||
|
@@ -124,24 +124,17 @@ extern void usage (void);
|
|||||||
* that only the actual options that we support will be
|
* that only the actual options that we support will be
|
||||||
* passed off to getopt().
|
* passed off to getopt().
|
||||||
*/
|
*/
|
||||||
char valid_opts[] = {
|
char valid_opts[] = "Bd:hklnS:u:UL:y"
|
||||||
'B', 'd', ':', 'h', 'k', 'l', 'n', 'S', ':', 'u', ':', 'U',
|
#ifdef AUTHENTICATION
|
||||||
#ifdef AUTHENTICATION
|
"a:X:z"
|
||||||
'a', ':', 'X', ':',
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef DIAGNOSTICS
|
#ifdef DIAGNOSTICS
|
||||||
'D', ':',
|
"D:"
|
||||||
#endif
|
#endif
|
||||||
#ifdef _CRAY
|
#ifdef _CRAY
|
||||||
'r', ':',
|
"r:"
|
||||||
#endif
|
#endif
|
||||||
'L', ':',
|
;
|
||||||
#ifdef AUTHENTICATION
|
|
||||||
'y',
|
|
||||||
'z',
|
|
||||||
#endif
|
|
||||||
'\0'
|
|
||||||
};
|
|
||||||
|
|
||||||
void doit(struct sockaddr_in*);
|
void doit(struct sockaddr_in*);
|
||||||
|
|
||||||
@@ -308,9 +301,11 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
auth_disable_name(optarg);
|
auth_disable_name(optarg);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case 'y':
|
case 'y':
|
||||||
no_warn = 1;
|
no_warn = 1;
|
||||||
break;
|
break;
|
||||||
|
#ifdef AUTHENTICATION
|
||||||
case 'z':
|
case 'z':
|
||||||
log_unauth = 1;
|
log_unauth = 1;
|
||||||
break;
|
break;
|
||||||
@@ -670,8 +665,6 @@ char *hostname;
|
|||||||
char host_name[MaxHostNameLen];
|
char host_name[MaxHostNameLen];
|
||||||
char remote_host_name[MaxHostNameLen];
|
char remote_host_name[MaxHostNameLen];
|
||||||
|
|
||||||
extern void telnet (int, int);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get a pty, scan input lines.
|
* Get a pty, scan input lines.
|
||||||
*/
|
*/
|
||||||
@@ -765,11 +758,6 @@ Please contact your net administrator");
|
|||||||
level = getterminaltype(user_name);
|
level = getterminaltype(user_name);
|
||||||
setenv("TERM", terminaltype ? terminaltype : "network", 1);
|
setenv("TERM", terminaltype ? terminaltype : "network", 1);
|
||||||
|
|
||||||
/*
|
|
||||||
* Start up the login process on the slave side of the terminal
|
|
||||||
*/
|
|
||||||
startslave(host, level, user_name);
|
|
||||||
|
|
||||||
#ifdef _SC_CRAY_SECURE_SYS
|
#ifdef _SC_CRAY_SECURE_SYS
|
||||||
if (secflag) {
|
if (secflag) {
|
||||||
if (setulvl(dv.dv_actlvl) < 0)
|
if (setulvl(dv.dv_actlvl) < 0)
|
||||||
@@ -779,7 +767,7 @@ Please contact your net administrator");
|
|||||||
}
|
}
|
||||||
#endif /* _SC_CRAY_SECURE_SYS */
|
#endif /* _SC_CRAY_SECURE_SYS */
|
||||||
|
|
||||||
telnet(net, ourpty); /* begin server processing */
|
telnet(net, ourpty, host, level, user_name); /* begin server processing */
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
} /* end of doit */
|
} /* end of doit */
|
||||||
|
|
||||||
@@ -788,7 +776,7 @@ Please contact your net administrator");
|
|||||||
* hand data to telnet receiver finite state machine.
|
* hand data to telnet receiver finite state machine.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
telnet(int f, int p)
|
telnet(int f, int p, char *host, int level, char *autoname)
|
||||||
{
|
{
|
||||||
int on = 1;
|
int on = 1;
|
||||||
#define TABBUFSIZ 512
|
#define TABBUFSIZ 512
|
||||||
@@ -800,6 +788,8 @@ telnet(int f, int p)
|
|||||||
char *IM;
|
char *IM;
|
||||||
void netflush();
|
void netflush();
|
||||||
int nfd;
|
int nfd;
|
||||||
|
int startslave_called = 0;
|
||||||
|
time_t timeout;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the slc mapping table.
|
* Initialize the slc mapping table.
|
||||||
@@ -965,10 +955,18 @@ telnet(int f, int p)
|
|||||||
|
|
||||||
|
|
||||||
nfd = ((f > p) ? f : p) + 1;
|
nfd = ((f > p) ? f : p) + 1;
|
||||||
|
timeout = time(NULL) + 5;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
fd_set ibits, obits, xbits;
|
fd_set ibits, obits, xbits;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
/* wait for encryption to be turned on, but don't wait
|
||||||
|
indefinitely */
|
||||||
|
if(!startslave_called && (!encrypt_delay() || timeout > time(NULL))){
|
||||||
|
startslave_called = 1;
|
||||||
|
startslave(host, level, autoname);
|
||||||
|
}
|
||||||
|
|
||||||
if (ncc < 0 && pcc < 0)
|
if (ncc < 0 && pcc < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user