diff options
| author | millert <> | 1996-09-01 21:25:35 +0000 |
|---|---|---|
| committer | millert <> | 1996-09-01 21:25:35 +0000 |
| commit | 688d1527654fd3ee1e48805dc7cf24fea56aa927 (patch) | |
| tree | 1dc2d185710a8616db4d641caf517417b52448b6 /src/lib/libc | |
| parent | 3c80fbbadfa04cbf4809c790d6b7be31beca12bf (diff) | |
| download | openbsd-688d1527654fd3ee1e48805dc7cf24fea56aa927.tar.gz openbsd-688d1527654fd3ee1e48805dc7cf24fea56aa927.tar.bz2 openbsd-688d1527654fd3ee1e48805dc7cf24fea56aa927.zip | |
First cut at man page for rcmdsh()
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/net/Makefile.inc | 5 | ||||
| -rw-r--r-- | src/lib/libc/net/rcmdsh.3 | 108 |
2 files changed, 111 insertions, 2 deletions
diff --git a/src/lib/libc/net/Makefile.inc b/src/lib/libc/net/Makefile.inc index 708684876a..04831f4f2d 100644 --- a/src/lib/libc/net/Makefile.inc +++ b/src/lib/libc/net/Makefile.inc | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile.inc,v 1.7 1996/08/22 20:11:19 millert Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.8 1996/09/01 21:25:34 millert Exp $ |
| 2 | 2 | ||
| 3 | # net sources | 3 | # net sources |
| 4 | .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/net ${.CURDIR}/net | 4 | .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/net ${.CURDIR}/net |
| @@ -19,7 +19,8 @@ SRCS+= gethostnamadr.c getnetbyaddr.c getnetbyname.c getnetent.c \ | |||
| 19 | .include "${.CURDIR}/arch/${MACHINE_ARCH}/net/Makefile.inc" | 19 | .include "${.CURDIR}/arch/${MACHINE_ARCH}/net/Makefile.inc" |
| 20 | 20 | ||
| 21 | MAN+= byteorder.3 ethers.3 gethostbyname.3 getnetent.3 getprotoent.3 \ | 21 | MAN+= byteorder.3 ethers.3 gethostbyname.3 getnetent.3 getprotoent.3 \ |
| 22 | getservent.3 inet.3 iso_addr.3 link_addr.3 ns.3 ipx.3 rcmd.3 resolver.3 | 22 | getservent.3 inet.3 iso_addr.3 link_addr.3 ns.3 ipx.3 rcmd.3 rcmdsh.3 \ |
| 23 | resolver.3 | ||
| 23 | 24 | ||
| 24 | MLINKS+=byteorder.3 htonl.3 byteorder.3 htons.3 byteorder.3 ntohl.3 \ | 25 | MLINKS+=byteorder.3 htonl.3 byteorder.3 htons.3 byteorder.3 ntohl.3 \ |
| 25 | byteorder.3 ntohs.3 | 26 | byteorder.3 ntohs.3 |
diff --git a/src/lib/libc/net/rcmdsh.3 b/src/lib/libc/net/rcmdsh.3 new file mode 100644 index 0000000000..64fe5e6a7d --- /dev/null +++ b/src/lib/libc/net/rcmdsh.3 | |||
| @@ -0,0 +1,108 @@ | |||
| 1 | .\" $OpenBSD: rcmdsh.3,v 1.1 1996/09/01 21:25:35 millert Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 1983, 1991, 1993 | ||
| 4 | .\" The Regents of the University of California. All rights reserved. | ||
| 5 | .\" | ||
| 6 | .\" Redistribution and use in source and binary forms, with or without | ||
| 7 | .\" modification, are permitted provided that the following conditions | ||
| 8 | .\" are met: | ||
| 9 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 10 | .\" notice, this list of conditions and the following disclaimer. | ||
| 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | .\" notice, this list of conditions and the following disclaimer in the | ||
| 13 | .\" documentation and/or other materials provided with the distribution. | ||
| 14 | .\" 3. All advertising materials mentioning features or use of this software | ||
| 15 | .\" must display the following acknowledgement: | ||
| 16 | .\" This product includes software developed by the University of | ||
| 17 | .\" California, Berkeley and its contributors. | ||
| 18 | .\" 4. Neither the name of the University nor the names of its contributors | ||
| 19 | .\" may be used to endorse or promote products derived from this software | ||
| 20 | .\" without specific prior written permission. | ||
| 21 | .\" | ||
| 22 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 23 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 24 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 25 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 26 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 27 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 28 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 29 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 30 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 32 | .\" SUCH DAMAGE. | ||
| 33 | .\" | ||
| 34 | .Dd Sep 1, 1996 | ||
| 35 | .Dt RCMDSH 3 | ||
| 36 | .Os OpenBSD | ||
| 37 | .Sh NAME | ||
| 38 | .Nm rcmd | ||
| 39 | .Nd return a stream to a remote command as unprivileged user | ||
| 40 | .Sh SYNOPSIS | ||
| 41 | .Fd #include <unistd.h> | ||
| 42 | .Ft int | ||
| 43 | .Fn rcmdsh "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "char *rshprog" | ||
| 44 | .Sh DESCRIPTION | ||
| 45 | The | ||
| 46 | .Fn rcmdsh | ||
| 47 | function | ||
| 48 | is used by normal users to execute a command on | ||
| 49 | a remote machine using an authentication scheme based | ||
| 50 | on reserved port numbers using | ||
| 51 | .Xr rshd 8 | ||
| 52 | or the value of | ||
| 53 | .Fa rshprog | ||
| 54 | (if non-NULL). | ||
| 55 | .Pp | ||
| 56 | The | ||
| 57 | .Fn rcmdsh | ||
| 58 | function | ||
| 59 | looks up the host | ||
| 60 | .Fa *ahost | ||
| 61 | using | ||
| 62 | .Xr gethostbyname 3 , | ||
| 63 | returning \-1 if the host does not exist. | ||
| 64 | Otherwise | ||
| 65 | .Fa *ahost | ||
| 66 | is set to the standard name of the host | ||
| 67 | and a connection is established to a server | ||
| 68 | residing at the well-known Internet port | ||
| 69 | .Li shell/tcp | ||
| 70 | (or whatever port is used by | ||
| 71 | .Fa rshprog | ||
| 72 | ). The parameter | ||
| 73 | .Fa inport | ||
| 74 | is ignored; it is only included to provide an interface similar to | ||
| 75 | .Xr rcmd 3 . | ||
| 76 | .Pp | ||
| 77 | If the connection succeeds, | ||
| 78 | a socket in the | ||
| 79 | .Tn UNIX | ||
| 80 | domain of type | ||
| 81 | .Dv SOCK_STREAM | ||
| 82 | is returned to the caller, and given to the remote | ||
| 83 | command as | ||
| 84 | .Em stdin | ||
| 85 | and | ||
| 86 | .Em stdout , | ||
| 87 | and | ||
| 88 | .Em stderr . | ||
| 89 | .Sh DIAGNOSTICS | ||
| 90 | The | ||
| 91 | .Fn rcmdsh | ||
| 92 | function | ||
| 93 | returns a valid socket descriptor on success. | ||
| 94 | It returns \-1 on error and prints a diagnostic message on the standard error. | ||
| 95 | .Sh SEE ALSO | ||
| 96 | .Xr rsh 1 , | ||
| 97 | .Xr socketpair 2 , | ||
| 98 | .Xr rcmd 3 , | ||
| 99 | .Xr rshd 8 | ||
| 100 | .Sh BUGS | ||
| 101 | If | ||
| 102 | .Xr rsh 1 | ||
| 103 | gets an error a file descriptor is still returned instead of \-1. | ||
| 104 | .Sh HISTORY | ||
| 105 | The | ||
| 106 | .Fn rcmdsh | ||
| 107 | function first appeared in | ||
| 108 | .Bx Open . | ||
