summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/rcmd.3
diff options
context:
space:
mode:
authoritojun <>2000-01-27 05:18:47 +0000
committeritojun <>2000-01-27 05:18:47 +0000
commit01a88624fac1f29e9deeedc05b266b38255068c5 (patch)
tree1c90d0b5f77b389005ad7de5528a1c4347523769 /src/lib/libc/net/rcmd.3
parentb2771c0992b93d3fc05508e5ff024fc970f22653 (diff)
downloadopenbsd-01a88624fac1f29e9deeedc05b266b38255068c5.tar.gz
openbsd-01a88624fac1f29e9deeedc05b266b38255068c5.tar.bz2
openbsd-01a88624fac1f29e9deeedc05b266b38255068c5.zip
add IPv6-ready rcmd() friends.
rcmd(): IPv4 only rcmd_af(): af independent ruserok(): af independent iruserok(): IPv4 only iruserok_sa(): af independent
Diffstat (limited to 'src/lib/libc/net/rcmd.3')
-rw-r--r--src/lib/libc/net/rcmd.343
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
57The 63The
58.Fn rcmd 64.Fn rcmd
@@ -74,6 +80,12 @@ will invoke
74.Xr rcmdsh 3 80.Xr rcmdsh 3
75to run the command via 81to run the command via
76.Xr rsh 1 . 82.Xr rsh 1 .
83While
84.Fn rcmd
85can handle IPv4 cases only,
86the
87.Fn rcmd_af
88function can handle other cases as well.
77The 89The
78.Fn rresvport 90.Fn rresvport
79and 91and
@@ -92,6 +104,9 @@ All four functions are present in the same file and are used
92by the 104by the
93.Xr rshd 8 105.Xr rshd 8
94server (among others). 106server (among others).
107.Fn iruserok_sa
108is an address family independent variant of
109.Fn iruserok .
95.Pp 110.Pp
96The 111The
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
143must be 0. 158must be 0.
144.Pp 159.Pp
160.Fn rcmd_af
161takes address family in the last argument.
162If the last argument is
163.Dv PF_UNSPEC ,
164interpretation of
165.Fa *ahost
166will obey the underlying address resolution like DNS.
167.Pp
145The protocol is described in detail in 168The 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,
200should be used in preference to 223should be used in preference to
201.Fn ruserok , 224.Fn ruserok ,
202as it does not require trusting the DNS server for the remote host's domain. 225as it does not require trusting the DNS server for the remote host's domain.
226.Pp
227While
228.Fn iruserok
229can handle IPv4 addresses only,
230.Fn iruserok_sa
231and
232.Fn ruserok
233can handle other address families as well, like IPv6.
234The first argument of
235.Fn iruserok_sa
236is typed as
237.Fa "void *"
238to avoid dependency between
239.Aq Li unistd.h
240and
241.Aq Li sys/socket.h .
203.Sh DIAGNOSTICS 242.Sh DIAGNOSTICS
204The 243The
205.Fn rcmd 244.Fn rcmd