X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/4fb1c17114e5b14e2613e755dda2f73993535f99..fad613b52dda8749b9b9e5493557045b54baf496:/usr/src/lib/libc/net/rcmd.3 diff --git a/usr/src/lib/libc/net/rcmd.3 b/usr/src/lib/libc/net/rcmd.3 index 942053f4eb..ba150de4a5 100644 --- a/usr/src/lib/libc/net/rcmd.3 +++ b/usr/src/lib/libc/net/rcmd.3 @@ -2,20 +2,18 @@ .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)rcmd.3 6.4 (Berkeley) %G% +.\" @(#)rcmd.3 6.8 (Berkeley) %G% .\" -.TH RCMD 3X "" +.TH RCMD 3 "" .UC 5 .SH NAME rcmd, rresvport, ruserok \- routines for returning a stream to a remote command .SH SYNOPSIS .nf .PP -.B "#include " -.PP .B "rem = rcmd(ahost, inport, locuser, remuser, cmd, fd2p);" .B char **ahost; -.B u_short inport; +.B int inport; .B "char *locuser, *remuser, *cmd;" .B int *fd2p; .PP @@ -57,7 +55,8 @@ and a connection is established to a server residing at the well-known Internet port .IR inport . .PP -If the call succeeds, a socket of type SOCK_STREAM +If the connection succeeds, +a socket in the Internet domain of type SOCK_STREAM is returned to the caller, and given to the remote command as .B stdin @@ -93,21 +92,20 @@ routine is used to obtain a socket with a privileged address bound to it. This socket is suitable for use by .I rcmd -and several other routines. Privileged addresses consist -of a port in the range 0 to 1023. Only the super-user +and several other routines. Privileged Internet ports are those +in the range 0 to 1023. Only the super-user is allowed to bind an address of this sort to a socket. .PP .I Ruserok takes a remote host's name, as returned by a -.IR gethostent (3N) -routine, two user names and a flag indicating if -the local user's name is the super-user. It then +.IR gethostbyaddr (3N) +routine, two user names and a flag indicating whether +the local user's name is that of the super-user. It then checks the file .I /etc/hosts.equiv and, possibly, .I .rhosts -in the current working directory (normally the local -user's home directory) to see if the request for +in the local user's home directory to see if the request for service is allowed. A 0 is returned if the machine name is listed in the ``hosts.equiv'' file, or the host and remote user name are found in the ``.rhosts'' @@ -115,19 +113,26 @@ file; otherwise .I ruserok returns \-1. If the .I superuser -flag is 1, the checking of the ``host.equiv'' file is +flag is 1, the checking of the ``hosts.equiv'' file is bypassed. +If the local domain (as obtained from \fIgethostname\fP\|(2)) +is the same as the remote domain, only the machine name need be specified. .SH SEE ALSO rlogin(1C), rsh(1C), -rexec(3X), +intro(2), +rexec(3), rexecd(8C), rlogind(8C), rshd(8C) -.SH BUGS -There is no way to specify options to the -.I socket -call -which -.I rcmd -makes. +.SH DIAGNOSTICS +.I Rcmd +returns a valid socket descriptor on success. +It returns -1 on error and prints a diagnostic message on the standard error. +.PP +.I Rresvport +returns a valid, bound socket descriptor on success. +It returns -1 on error with the global value +.I errno +set according to the reason for failure. +The error code EAGAIN is overloaded to mean ``All network ports in use.''