diff options
| author | cvs2svn <admin@example.com> | 1998-10-19 21:47:12 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 1998-10-19 21:47:12 +0000 |
| commit | 5170039cf1df2194faa85741f0733977525cd5c0 (patch) | |
| tree | c667406046ddb1efca5ed4316b02e43494241660 /src/lib/libc/net/rcmdsh.3 | |
| parent | 536c76cbb863bab152f19842ab88772c01e922c7 (diff) | |
| download | openbsd-OPENBSD_2_4_BASE.tar.gz openbsd-OPENBSD_2_4_BASE.tar.bz2 openbsd-OPENBSD_2_4_BASE.zip | |
This commit was manufactured by cvs2git to create tag 'OPENBSD_2_4_BASE'.OPENBSD_2_4_BASE
Diffstat (limited to 'src/lib/libc/net/rcmdsh.3')
| -rw-r--r-- | src/lib/libc/net/rcmdsh.3 | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/src/lib/libc/net/rcmdsh.3 b/src/lib/libc/net/rcmdsh.3 new file mode 100644 index 0000000000..fd89acee8f --- /dev/null +++ b/src/lib/libc/net/rcmdsh.3 | |||
| @@ -0,0 +1,108 @@ | |||
| 1 | .\" $OpenBSD: rcmdsh.3,v 1.3 1998/06/26 17:54:09 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 rcmdsh | ||
| 39 | .Nd return a stream to a remote command without superuser | ||
| 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 | .Ox 2.0 . | ||
