1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" SPDX-License-Identifier: BSD-4-Clause-UC
6 .\" @(#)rexec.3 8.1 (Berkeley) 6/4/93
7 .\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $
9 .\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk)
11 .\" 2013-06-21, mtk, Converted from mdoc to man macros
13 .TH REXEC 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
15 rexec, rexec_af \- return stream to a remote command
18 .RI ( libc ", " \-lc )
23 .BI "int rexec(char **restrict " ahost ", int " inport ,
24 .BI " const char *restrict " user ", const char *restrict " passwd ,
25 .BI " const char *restrict " cmd ", int *restrict " fd2p );
26 .BI "int rexec_af(char **restrict " ahost ", int " inport ,
27 .BI " const char *restrict " user ", const char *restrict " passwd ,
28 .BI " const char *restrict " cmd ", int *restrict " fd2p ,
29 .BI " sa_family_t " af );
37 In glibc up to and including 2.19:
41 This interface is obsoleted by
50 .BR gethostbyname (3),
51 returning \-1 if the host does not exist.
54 is set to the standard name of the host.
55 If a username and password are both specified, then these
56 are used to authenticate to the foreign host; otherwise
57 the environment and then the
60 home directory are searched for appropriate information.
61 If all this fails, the user is prompted for the information.
65 specifies which well-known DARPA Internet port to use for
66 the connection; the call
67 .I "getservbyname(""exec"", ""tcp"")"
70 will return a pointer to a structure that contains the necessary port.
71 The protocol for connection is described in detail in
74 If the connection succeeds,
75 a socket in the Internet domain of type
78 the caller, and given to the remote command as
84 is nonzero, then an auxiliary channel to a control
85 process will be setup, and a file descriptor for it will be placed
88 The control process will return diagnostic
89 output from the command (unit 2) on this channel, and will also
90 accept bytes on this channel as being UNIX signal numbers, to be
91 forwarded to the process group of the command.
93 information returned does not include remote authorization failure,
94 as the secondary connection is set up after authorization has been
100 (unit 2 of the remote
101 command) will be made the same as the
104 provision is made for sending arbitrary signals to the remote process,
105 although you may be able to get its attention by using out-of-band data.
109 function works over IPv4
113 function provides an extra argument,
115 that allows the caller to select the protocol.
116 This argument can be specified as
121 (to allow the implementation to select the protocol).
125 function was added to glibc in version 2.2.
127 For an explanation of the terms used in this section, see
135 Interface Attribute Value
139 T} Thread safety MT-Unsafe
145 These functions are not in POSIX.1.
148 function first appeared in
149 4.2BSD, and is present on the BSDs, Solaris, and many other systems.
152 function is more recent, and less widespread.
156 function sends the unencrypted password across the network.
158 The underlying service is considered a big security hole and therefore
159 not enabled on many sites; see