summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/rcmd.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/rcmd.3')
-rw-r--r--src/lib/libc/net/rcmd.338
1 files changed, 18 insertions, 20 deletions
diff --git a/src/lib/libc/net/rcmd.3 b/src/lib/libc/net/rcmd.3
index c68a3338a0..d086e875bf 100644
--- a/src/lib/libc/net/rcmd.3
+++ b/src/lib/libc/net/rcmd.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: rcmd.3,v 1.12 1999/05/23 14:11:02 aaron Exp $ 1.\" $OpenBSD: rcmd.3,v 1.13 1999/07/05 04:41:00 aaron Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -56,15 +56,15 @@ The
56function 56function
57is used by the super-user to execute a command on a remote 57is used by the super-user to execute a command on a remote
58machine using an authentication scheme based on reserved 58machine using an authentication scheme based on reserved
59port numbers. If the calling process is not setuid and the 59port numbers. If the calling process is not setuid, the
60.Li RSH 60.Ev RSH
61environment variable is set and 61environment variable is set, and
62.Fa inport 62.Fa inport
63is 63is
64.Li shell/tcp , 64.Dq shell/tcp ,
65.Xr rcmdsh 3 65.Xr rcmdsh 3
66is called instead with the value of 66is called instead with the value of
67.Li RSH . 67.Ev RSH .
68Alternately, if the user is not the super-user, 68Alternately, if the user is not the super-user,
69.Fn rcmd 69.Fn rcmd
70will invoke 70will invoke
@@ -103,17 +103,14 @@ and a connection is established to a server
103residing at the well-known Internet port 103residing at the well-known Internet port
104.Fa inport . 104.Fa inport .
105If the user is not the super-user, the only valid port is 105If the user is not the super-user, the only valid port is
106.Li shell/tcp , 106.Dq shell/tcp
107(usually port 514). 107(usually port 514).
108.Pp 108.Pp
109If the connection succeeds, 109If the connection succeeds,
110a socket in the Internet domain of type 110a socket in the Internet domain of type
111.Dv SOCK_STREAM 111.Dv SOCK_STREAM
112is returned to the caller, and given to the remote 112is returned to the caller, and given to the remote
113command as 113command as stdin and stdout.
114.Em stdin
115and
116.Em stdout .
117If 114If
118.Fa fd2p 115.Fa fd2p
119is non-zero, then an auxiliary channel to a control 116is non-zero, then an auxiliary channel to a control
@@ -128,10 +125,10 @@ signal numbers, to be
128forwarded to the process group of the command. 125forwarded to the process group of the command.
129If 126If
130.Fa fd2p 127.Fa fd2p
131is 0, then the 128is 0, then the
132.Em stderr 129.Em stderr
133(unit 2 of the remote 130(unit 2 of the remote
134command) will be made the same as the 131command) will be made the same as the
135.Em stdout 132.Em stdout
136and no 133and no
137provision is made for sending arbitrary signals to the remote process, 134provision is made for sending arbitrary signals to the remote process,
@@ -147,7 +144,7 @@ The
147.Fn rresvport 144.Fn rresvport
148function is used to obtain a socket with a privileged 145function is used to obtain a socket with a privileged
149address bound to it. This socket is suitable for use 146address bound to it. This socket is suitable for use
150by 147by
151.Fn rcmd 148.Fn rcmd
152and several other functions. Privileged Internet ports are those 149and several other functions. Privileged Internet ports are those
153in the range 0 to 1023. Only the super-user 150in the range 0 to 1023. Only the super-user
@@ -164,7 +161,7 @@ functions take a remote host's IP address or name, respectively,
164two user names and a flag indicating whether the local user's 161two user names and a flag indicating whether the local user's
165name is that of the super-user. 162name is that of the super-user.
166Then, if the user is 163Then, if the user is
167.Em NOT 164.Em not
168the super-user, it checks the 165the super-user, it checks the
169.Pa /etc/hosts.equiv 166.Pa /etc/hosts.equiv
170file. 167file.
@@ -177,9 +174,9 @@ If this file does not exist, is not a regular file, is owned by anyone
177other than the user or the super-user, or is writeable by anyone other 174other than the user or the super-user, or is writeable by anyone other
178than the owner, the check automatically fails. 175than the owner, the check automatically fails.
179Zero is returned if the machine name is listed in the 176Zero is returned if the machine name is listed in the
180.Dq Pa hosts.equiv 177.Pa hosts.equiv
181file, or the host and remote user name are found in the 178file, or the host and remote user name are found in the
182.Dq Pa .rhosts 179.Pa .rhosts
183file; otherwise 180file; otherwise
184.Fn iruserok 181.Fn iruserok
185and 182and
@@ -209,8 +206,9 @@ It returns \-1 on error with the global value
209.Va errno 206.Va errno
210set according to the reason for failure. 207set according to the reason for failure.
211The error code 208The error code
212.Dv EAGAIN 209.Er EAGAIN
213is overloaded to mean ``All network ports in use.'' 210is overloaded to mean
211.Dq all network ports in use .
214.Sh SEE ALSO 212.Sh SEE ALSO
215.Xr rlogin 1 , 213.Xr rlogin 1 ,
216.Xr rsh 1 , 214.Xr rsh 1 ,
@@ -223,5 +221,5 @@ is overloaded to mean ``All network ports in use.''
223.Xr rshd 8 221.Xr rshd 8
224.Sh HISTORY 222.Sh HISTORY
225These 223These
226functions appeared in 224functions appeared in
227.Bx 4.2 . 225.Bx 4.2 .