Do not repeat option name in its definition. Use .Nm. In the sequence ``~.'',

``.'' is not a sentence termination, it must be escaped to be put inside
quotes.
Abort if execv() fails by adding err(). Do not dot terminate error messages.
This commit is contained in:
charnier 2002-10-16 12:33:14 +00:00
parent 3a88c84c05
commit c106559170
2 changed files with 34 additions and 44 deletions

View File

@ -59,84 +59,68 @@ first attempts to use the Kerberos authorization mechanism, described below.
If the remote host does not support Kerberos the standard Berkeley
.Pa rhosts
authorization mechanism is used.
The options are as follows:
.Pp
The following options are available:
.Bl -tag -width flag
.It Fl 4
Use IPv4 addresses only.
.It Fl 6
Use IPv6 addresses only.
.It Fl 8
The
.Fl 8
option allows an eight-bit input data path at all times; otherwise
Allow an eight-bit input data path at all times; otherwise
parity bits are stripped except when the remote side's stop and start
characters are other than
^S/^Q.
.It Fl D
The
.Fl D
option sets the TCP_NODELAY socket option which can improve interactive response
Set the TCP_NODELAY socket option which can improve interactive response
at the expense of increased network load.
.It Fl E
The
.Fl E
option stops any character from being recognized as an escape character.
Stop any character from being recognized as an escape character.
When used with the
.Fl 8
option, this provides a completely transparent connection.
.It Fl K
The
.Fl K
option turns off all Kerberos authentication.
Turn off all Kerberos authentication.
.It Fl L
The
.Fl L
option allows the rlogin session to be run in
Allow the
.Nm
session to be run in
.Dq litout
(see
.Xr tty 4 )
mode.
.It Fl d
The
.Fl d
option turns on socket debugging (see
Turn on socket debugging (see
.Xr setsockopt 2 )
on the TCP sockets used for communication with the remote host.
.It Fl e
The
.Fl e
option allows user specification of the escape character, which is
Allow user specification of the escape character, which is
.Dq ~
by default.
This specification may be as a literal character, or as an octal
value in the form \ennn.
.It Fl i
The
.Fl i
option allows the caller to specify a different local name to be used
Allow the caller to specify a different local name to be used
for authentication. This option is restricted to processes with uid 0.
.It Fl k
The
.Fl k
option requests rlogin to obtain tickets for the remote host
Request
.Nm
to obtain tickets for the remote host
in realm
.Ar realm
instead of the remote host's realm as determined by
.Xr krb_realmofhost 3 .
.It Fl l
The
.Fl l
option specifies a different
Specify a different
.Ar username
for the remote login.
If this option is not specified, your local username will be used.
.It Fl x
The
.Fl x
option turns on
Turn on
.Tn DES
encryption for all data passed via the
rlogin session.
.Nm
session.
This may impact response time and
.Tn CPU
utilization, but provides
@ -144,7 +128,7 @@ increased security.
.El
.Pp
A line of the form
.Dq Aq escape char .
.Dq Ao escape char Ac Ns \&.
disconnects from the remote host.
Similarly, the line
.Dq Ao escape char Ac Ns ^Z
@ -153,7 +137,9 @@ will suspend the
session, and
.Dq Ao escape\ char Ac Ns Ao delayed-suspend\ char Ac
suspends the
send portion of the rlogin, but allows output from the remote system.
send portion of the
.Nm
session, but allows output from the remote system.
By default, the tilde
.Pq Dq ~
character is the escape character, and

View File

@ -44,15 +44,18 @@ static const char copyright[] =
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#if 0
#ifndef lint
static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* rlogin - remote login
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/socket.h>
@ -314,7 +317,7 @@ main(int argc, char *argv[])
sp = getservbyname("login", "tcp");
if (sp == NULL)
errx(1, "unknown service login/tcp");
errx(1, "login/tcp: unknown service");
if (errno == ECONNREFUSED)
warn("remote host doesn't support Kerberos");
if (errno == ENOENT)
@ -328,6 +331,7 @@ main(int argc, char *argv[])
newargv[i + 1] = argv[i];
newargv[argc + 1] = NULL;
execv(_PATH_RLOGIN, newargv);
err(1, "can't exec %s", _PATH_RLOGIN);
}
} else {
#ifdef CRYPT
@ -401,11 +405,11 @@ doit(long omask)
if (child == 0) {
mode(1);
if (reader(omask) == 0) {
msg("connection closed.");
msg("connection closed");
exit(0);
}
sleep(1);
msg("\007connection closed.");
msg("\007connection closed");
exit(1);
}
@ -419,7 +423,7 @@ doit(long omask)
(void)sigsetmask(omask);
(void)signal(SIGCHLD, catch_child);
writer();
msg("closed connection.");
msg("closed connection");
done(0);
}
@ -835,7 +839,7 @@ void
lostpeer(int signo __unused)
{
(void)signal(SIGPIPE, SIG_IGN);
msg("\007connection closed.");
msg("\007connection closed");
done(1);
}