1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by the University of
16 .\" California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)rexec.3 8.1 (Berkeley) 6/4/93
35 .\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $
37 .\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk)
39 .\" 2013-06-21, mtk, Converted from mdoc to man macros
41 .TH REXEC 3 2021-03-22 "Linux" "Linux Programmer's Manual"
43 rexec, rexec_af \- return stream to a remote command
48 .BI "int rexec(char **restrict " ahost ", int " inport ,
49 .BI " const char *restrict " user ", const char *restrict " passwd ,
50 .BI " const char *restrict " cmd ", int *restrict " fd2p );
51 .BI "int rexec_af(char **restrict " ahost ", int " inport ,
52 .BI " const char *restrict " user ", const char *restrict " passwd ,
53 .BI " const char *restrict " cmd ", int *restrict " fd2p ,
54 .BI " sa_family_t " af );
62 In glibc up to and including 2.19:
66 This interface is obsoleted by
75 .BR gethostbyname (3),
76 returning \-1 if the host does not exist.
79 is set to the standard name of the host.
80 If a username and password are both specified, then these
81 are used to authenticate to the foreign host; otherwise
82 the environment and then the
85 home directory are searched for appropriate information.
86 If all this fails, the user is prompted for the information.
90 specifies which well-known DARPA Internet port to use for
91 the connection; the call
92 .I "getservbyname(""exec"", ""tcp"")"
95 will return a pointer to a structure that contains the necessary port.
96 The protocol for connection is described in detail in
99 If the connection succeeds,
100 a socket in the Internet domain of type
103 the caller, and given to the remote command as
109 is nonzero, then an auxiliary channel to a control
110 process will be setup, and a file descriptor for it will be placed
113 The control process will return diagnostic
114 output from the command (unit 2) on this channel, and will also
115 accept bytes on this channel as being UNIX signal numbers, to be
116 forwarded to the process group of the command.
118 information returned does not include remote authorization failure,
119 as the secondary connection is set up after authorization has been
125 (unit 2 of the remote
126 command) will be made the same as the
129 provision is made for sending arbitrary signals to the remote process,
130 although you may be able to get its attention by using out-of-band data.
134 function works over IPv4
138 function provides an extra argument,
140 that allows the caller to select the protocol.
141 This argument can be specified as
146 (to allow the implementation to select the protocol).
150 function was added to glibc in version 2.2.
152 For an explanation of the terms used in this section, see
160 Interface Attribute Value
164 T} Thread safety MT-Unsafe
170 These functions are not in POSIX.1.
173 function first appeared in
174 4.2BSD, and is present on the BSDs, Solaris, and many other systems.
177 function is more recent, and less widespread.
181 function sends the unencrypted password across the network.
183 The underlying service is considered a big security hole and therefore
184 not enabled on many sites; see