Use err(3) instead of local definition.
Cosmetic in man page: do not start describing a flag with `The option -X ..'.
This commit is contained in:
parent
e25f6756fb
commit
ed43a0f914
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27954
@ -38,7 +38,7 @@
|
||||
.Nm rsh
|
||||
.Nd remote shell
|
||||
.Sh SYNOPSIS
|
||||
.Nm rsh
|
||||
.Nm
|
||||
.Op Fl Kdnx
|
||||
.Op Fl t Ar timeout
|
||||
.Op Fl k Ar realm
|
||||
@ -58,27 +58,21 @@ output of the remote command to its standard output, and the
|
||||
standard error of the remote command to its standard error.
|
||||
Interrupt, quit and terminate signals are propagated to the remote
|
||||
command;
|
||||
.Nm rsh
|
||||
.Nm
|
||||
normally terminates when the remote command does.
|
||||
The options are as follows:
|
||||
.Bl -tag -width flag
|
||||
.It Fl K
|
||||
The
|
||||
.Fl K
|
||||
option turns off all Kerberos authentication.
|
||||
Turn off all Kerberos authentication.
|
||||
.It Fl d
|
||||
The
|
||||
.Fl d
|
||||
option turns on socket debugging (using
|
||||
Turn on socket debugging (using
|
||||
.Xr setsockopt 2 )
|
||||
on the
|
||||
.Tn TCP
|
||||
sockets used for communication with the remote host.
|
||||
.It Fl k
|
||||
The
|
||||
.Fl k
|
||||
option causes
|
||||
.Nm rsh
|
||||
Cause
|
||||
.Nm
|
||||
to obtain tickets for the remote host in
|
||||
.Ar realm
|
||||
instead of the remote host's realm as determined by
|
||||
@ -92,24 +86,18 @@ Kerberos authentication is used, and authorization is determined
|
||||
as in
|
||||
.Xr rlogin 1 .
|
||||
.It Fl n
|
||||
The
|
||||
.Fl n
|
||||
option redirects input from the special device
|
||||
Redirect input from the special device
|
||||
.Pa /dev/null
|
||||
(see the
|
||||
.Sx BUGS
|
||||
section of this manual page).
|
||||
.It Fl x
|
||||
The
|
||||
.Fl x
|
||||
option turns on
|
||||
Turn on
|
||||
.Tn DES
|
||||
encryption for all data exchange.
|
||||
This may introduce a significant delay in response time.
|
||||
.It Fl t
|
||||
The
|
||||
.Fl t
|
||||
option allows a timeout to be specified (in seconds). If no
|
||||
Allow a timeout to be specified (in seconds). If no
|
||||
data is sent or received in this time, rsh will exit.
|
||||
.El
|
||||
.Pp
|
||||
@ -158,18 +146,18 @@ to
|
||||
.Xr rshd 8
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm rsh
|
||||
.Nm
|
||||
command appeared in
|
||||
.Bx 4.2 .
|
||||
.Sh BUGS
|
||||
If you are using
|
||||
.Xr csh 1
|
||||
and put a
|
||||
.Nm rsh
|
||||
.Nm
|
||||
in the background without redirecting its input away from the terminal,
|
||||
it will block even if no reads are posted by the remote command.
|
||||
If no input is desired you should redirect the input of
|
||||
.Nm rsh
|
||||
.Nm
|
||||
to
|
||||
.Pa /dev/null
|
||||
using the
|
||||
@ -182,12 +170,12 @@ You cannot run an interactive command
|
||||
or
|
||||
.Xr vi 1 )
|
||||
using
|
||||
.Nm rsh ;
|
||||
.Nm rsh ;
|
||||
use
|
||||
.Xr rlogin 1
|
||||
.Xr rlogin 1
|
||||
instead.
|
||||
.Pp
|
||||
Stop signals stop the local
|
||||
.Nm rsh
|
||||
.Nm
|
||||
process only; this is arguably wrong, but currently hard to fix for reasons
|
||||
too complicated to explain here.
|
||||
|
@ -32,15 +32,17 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static const char copyright[] =
|
||||
"@(#) Copyright (c) 1983, 1990, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "From: @(#)rsh.c 8.3 (Berkeley) 4/6/94";
|
||||
#endif
|
||||
static char rcsid[] =
|
||||
"$Id: rsh.c,v 1.10 1997/02/22 19:56:46 peter Exp $";
|
||||
"$Id: rsh.c,v 1.11 1997/03/29 04:31:59 imp Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -85,7 +87,6 @@ char *copyargs __P((char **));
|
||||
void sendsig __P((int));
|
||||
void talk __P((int, long, pid_t, int, int));
|
||||
void usage __P((void));
|
||||
void warning __P(());
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
@ -209,7 +210,8 @@ main(argc, argv)
|
||||
sp = getservbyname((doencrypt ? "ekshell" : "kshell"), "tcp");
|
||||
if (sp == NULL) {
|
||||
use_kerberos = 0;
|
||||
warning("can't get entry for %s/tcp service",
|
||||
warnx(
|
||||
"warning, using standard rsh: can't get entry for %s/tcp service",
|
||||
doencrypt ? "ekshell" : "kshell");
|
||||
}
|
||||
}
|
||||
@ -249,9 +251,11 @@ main(argc, argv)
|
||||
if (sp == NULL)
|
||||
errx(1, "shell/tcp: unknown service");
|
||||
if (errno == ECONNREFUSED)
|
||||
warning("remote host doesn't support Kerberos");
|
||||
warnx(
|
||||
"warning, using standard rsh: remote host doesn't support Kerberos");
|
||||
if (errno == ENOENT)
|
||||
warning("can't provide Kerberos auth data");
|
||||
warnx(
|
||||
"warning, using standard rsh: can't provide Kerberos auth data");
|
||||
goto try_connect;
|
||||
}
|
||||
} else {
|
||||
@ -437,24 +441,6 @@ sendsig(sig)
|
||||
(void)write(rfd2, &signo, 1);
|
||||
}
|
||||
|
||||
#ifdef KERBEROS
|
||||
/* VARARGS */
|
||||
void
|
||||
warning(va_alist)
|
||||
va_dcl
|
||||
{
|
||||
va_list ap;
|
||||
char *fmt;
|
||||
|
||||
(void)fprintf(stderr, "rsh: warning, using standard rsh: ");
|
||||
va_start(ap);
|
||||
fmt = va_arg(ap, char *);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
(void)fprintf(stderr, ".\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
copyargs(argv)
|
||||
char **argv;
|
||||
|
Loading…
Reference in New Issue
Block a user