diff options
Diffstat (limited to 'src/lib/libc/net/rcmd.3')
-rw-r--r-- | src/lib/libc/net/rcmd.3 | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/lib/libc/net/rcmd.3 b/src/lib/libc/net/rcmd.3 index fa7be72c8d..6df614b419 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.16 2000/01/26 06:22:52 deraadt Exp $ | 1 | .\" $OpenBSD: rcmd.3,v 1.17 2000/01/27 05:18:47 itojun 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. |
@@ -36,16 +36,20 @@ | |||
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
38 | .Nm rcmd , | 38 | .Nm rcmd , |
39 | .Nm rcmd_af , | ||
39 | .Nm rresvport , | 40 | .Nm rresvport , |
40 | .Nm rresvport_af , | 41 | .Nm rresvport_af , |
41 | .Nm iruserok , | 42 | .Nm iruserok , |
42 | .Nm ruserok | 43 | .Nm ruserok , |
44 | .Nm iruserok_sa | ||
43 | .Nd routines for returning a stream to a remote command | 45 | .Nd routines for returning a stream to a remote command |
44 | .Sh SYNOPSIS | 46 | .Sh SYNOPSIS |
45 | .Fd #include <unistd.h> | 47 | .Fd #include <unistd.h> |
46 | .Ft int | 48 | .Ft int |
47 | .Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p" | 49 | .Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p" |
48 | .Ft int | 50 | .Ft int |
51 | .Fn rcmd_af "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p" "int af" | ||
52 | .Ft int | ||
49 | .Fn rresvport "int *port" | 53 | .Fn rresvport "int *port" |
50 | .Ft int | 54 | .Ft int |
51 | .Fn rresvport_af "int *port" "int af" | 55 | .Fn rresvport_af "int *port" "int af" |
@@ -53,6 +57,8 @@ | |||
53 | .Fn iruserok "u_int32_t raddr" "int superuser" "const char *ruser" "const char *luser" | 57 | .Fn iruserok "u_int32_t raddr" "int superuser" "const char *ruser" "const char *luser" |
54 | .Ft int | 58 | .Ft int |
55 | .Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser" | 59 | .Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser" |
60 | .Ft int | ||
61 | .Fn iruserok_sa "const void *sa" "int salen" "int superuser" "const char *ruser" | ||
56 | .Sh DESCRIPTION | 62 | .Sh DESCRIPTION |
57 | The | 63 | The |
58 | .Fn rcmd | 64 | .Fn rcmd |
@@ -74,6 +80,12 @@ will invoke | |||
74 | .Xr rcmdsh 3 | 80 | .Xr rcmdsh 3 |
75 | to run the command via | 81 | to run the command via |
76 | .Xr rsh 1 . | 82 | .Xr rsh 1 . |
83 | While | ||
84 | .Fn rcmd | ||
85 | can handle IPv4 cases only, | ||
86 | the | ||
87 | .Fn rcmd_af | ||
88 | function can handle other cases as well. | ||
77 | The | 89 | The |
78 | .Fn rresvport | 90 | .Fn rresvport |
79 | and | 91 | and |
@@ -92,6 +104,9 @@ All four functions are present in the same file and are used | |||
92 | by the | 104 | by the |
93 | .Xr rshd 8 | 105 | .Xr rshd 8 |
94 | server (among others). | 106 | server (among others). |
107 | .Fn iruserok_sa | ||
108 | is an address family independent variant of | ||
109 | .Fn iruserok . | ||
95 | .Pp | 110 | .Pp |
96 | The | 111 | The |
97 | .Fn rcmd | 112 | .Fn rcmd |
@@ -142,6 +157,14 @@ Note that if the user is not the super-user, | |||
142 | .Fa fd2p | 157 | .Fa fd2p |
143 | must be 0. | 158 | must be 0. |
144 | .Pp | 159 | .Pp |
160 | .Fn rcmd_af | ||
161 | takes address family in the last argument. | ||
162 | If the last argument is | ||
163 | .Dv PF_UNSPEC , | ||
164 | interpretation of | ||
165 | .Fa *ahost | ||
166 | will obey the underlying address resolution like DNS. | ||
167 | .Pp | ||
145 | The protocol is described in detail in | 168 | The protocol is described in detail in |
146 | .Xr rshd 8 . | 169 | .Xr rshd 8 . |
147 | .Pp | 170 | .Pp |
@@ -200,6 +223,22 @@ If the IP address of the remote host is known, | |||
200 | should be used in preference to | 223 | should be used in preference to |
201 | .Fn ruserok , | 224 | .Fn ruserok , |
202 | as it does not require trusting the DNS server for the remote host's domain. | 225 | as it does not require trusting the DNS server for the remote host's domain. |
226 | .Pp | ||
227 | While | ||
228 | .Fn iruserok | ||
229 | can handle IPv4 addresses only, | ||
230 | .Fn iruserok_sa | ||
231 | and | ||
232 | .Fn ruserok | ||
233 | can handle other address families as well, like IPv6. | ||
234 | The first argument of | ||
235 | .Fn iruserok_sa | ||
236 | is typed as | ||
237 | .Fa "void *" | ||
238 | to avoid dependency between | ||
239 | .Aq Li unistd.h | ||
240 | and | ||
241 | .Aq Li sys/socket.h . | ||
203 | .Sh DIAGNOSTICS | 242 | .Sh DIAGNOSTICS |
204 | The | 243 | The |
205 | .Fn rcmd | 244 | .Fn rcmd |