[\fB\-edebug\fP] [\fB\-h\fP] [\fB\-I\fP\fIinitid\fP] [\fB\-l\fP]
[\fB\-k\fP] [\fB\-n\fP] [\fB\-r\fP\fIlowpty-highpty\fP] [\fB\-s\fP]
[\fB\-S\fP \fItos\fP] [\fB\-U\fP] [\fB\-X\fP \fIauthtype\fP]
+[\fB\-u\fImaxhostlen\fP] [\fB\-i\fP] [\fB\-N\fP]
[\fB\-debug\fP [\fIport\fP]]
-.Sh DESCRIPTION
+.SH DESCRIPTION
The
.B telnetd
command is a server which supports the
.SM ID
is fe.
.TP
+.B \-i
+Cuases the IP address to be unconditionally passed to login(8).
+.TP
.B \-k
This option is only useful if
.B telnetd
.SM LINEMODE
option is not supported, it will go into kludge linemode.
.TP
+.B \-N
+Don't strip the local domain name for passing to login(1).
+.TP
.B \-n
Disable
.SM TCP
.IR gethostbyaddr (3)
routine.
.TP
+.B \-u
+.I maxhostlen
+Sets the maximum hostname length passed to login(1).
+.TP
\fB\-X\fP \fIauthtype\fP
This option is only valid if
.B telnetd
int keepalive = 1;
char *progname;
+int maxhostlen = 0;
+int always_ip = 0;
+int stripdomain = 1;
+
extern void usage P((void));
/*
*/
char valid_opts[] = {
'd', ':', 'h', 'k', 'L', ':', 'n', 'S', ':', 'U',
+ 'u', ':', 'i', 'N',
#ifdef AUTHENTICATION
'a', ':', 'X', ':',
#endif
auth_disable_name(optarg);
break;
#endif /* AUTHENTICATION */
+ case 'u':
+ maxhostlen = atoi(optarg);
+ break;
+ case 'i':
+ always_ip = 1;
+ break;
+ case 'N':
+ stripdomain = 0;
+ break;
default:
fprintf(stderr, "telnetd: %c: unknown option\n", ch);
char *hostname;
char host_name[MAXDNAME];
char remote_host_name[MAXDNAME];
+char *rhost_sane;
#ifndef convex
extern void telnet P((int, int));
}
#endif /* _SC_CRAY_SECURE_SYS */
+ retval = pty_make_sane_hostname(who, maxhostlen,
+ stripdomain, always_ip,
+ &rhost_sane);
+ if (retval) {
+ fatal(net, error_message(retval));
+ }
/* get name of connected client */
hp = gethostbyaddr((char *)&who->sin_addr, sizeof (struct in_addr),
who->sin_family);
if (hp == NULL && registerd_host_only) {
fatal(net, "Couldn't resolve your address into a host name.\r\n\
Please contact your net administrator");
- } else if (hp ) {
- host = hp->h_name;
- } else {
- host = inet_ntoa(who->sin_addr);
}
- /*
- * We must make a copy because Kerberos is probably going
- * to also do a gethost* and overwrite the static data...
- */
- strncpy(remote_host_name, host, sizeof(remote_host_name)-1);
- remote_host_name[sizeof(remote_host_name)-1] = 0;
- host = remote_host_name;
(void) gethostname(host_name, sizeof (host_name));
hostname = host_name;
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
- auth_encrypt_init(hostname, host, "TELNETD", 1);
+ auth_encrypt_init(hostname, rhost_sane, "TELNETD", 1);
#endif
init_env();
* Start up the login process on the slave side of the terminal
*/
#ifndef convex
- startslave(host, level, user_name);
+ startslave(rhost_sane, level, user_name);
#if defined(_SC_CRAY_SECURE_SYS)
if (secflag) {
telnet(net, pty); /* begin server processing */
#else
- telnet(net, pty, host);
+ telnet(net, pty, rhost_sane);
#endif
/*NOTREACHED*/
} /* end of doit */