2 .\" Copyright (c) 1983, 1991, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" SPDX-License-Identifier: BSD-4-Clause-UC
7 .\" @(#)rexec.3 8.1 (Berkeley) 6/4/93
8 .\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $
10 .\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk)
12 .\" 2013-06-21, mtk, Converted from mdoc to man macros
14 .TH rexec 3 (date) "Linux man-pages (unreleased)"
16 rexec, rexec_af \- return stream to a remote command
19 .RI ( libc ", " \-lc )
25 .BI "int rexec(char **restrict " ahost ", int " inport ,
26 .BI " const char *restrict " user ", const char *restrict " passwd ,
27 .BI " const char *restrict " cmd ", int *restrict " fd2p );
30 .BI "int rexec_af(char **restrict " ahost ", int " inport ,
31 .BI " const char *restrict " user ", const char *restrict " passwd ,
32 .BI " const char *restrict " cmd ", int *restrict " fd2p ,
33 .BI " sa_family_t " af );
41 In glibc up to and including 2.19:
45 This interface is obsoleted by
54 .BR gethostbyname (3),
55 returning \-1 if the host does not exist.
58 is set to the standard name of the host.
59 If a username and password are both specified, then these
60 are used to authenticate to the foreign host; otherwise
61 the environment and then the
64 home directory are searched for appropriate information.
65 If all this fails, the user is prompted for the information.
69 specifies which well-known DARPA Internet port to use for
70 the connection; the call
71 .I "getservbyname(""exec"", ""tcp"")"
74 will return a pointer to a structure that contains the necessary port.
75 The protocol for connection is described in detail in
78 If the connection succeeds,
79 a socket in the Internet domain of type
82 the caller, and given to the remote command as
88 is nonzero, then an auxiliary channel to a control
89 process will be setup, and a file descriptor for it will be placed
92 The control process will return diagnostic
93 output from the command (unit 2) on this channel, and will also
94 accept bytes on this channel as being UNIX signal numbers, to be
95 forwarded to the process group of the command.
97 information returned does not include remote authorization failure,
98 as the secondary connection is set up after authorization has been
104 (unit 2 of the remote
105 command) will be made the same as the
108 provision is made for sending arbitrary signals to the remote process,
109 although you may be able to get its attention by using out-of-band data.
113 function works over IPv4
117 function provides an extra argument,
119 that allows the caller to select the protocol.
120 This argument can be specified as
125 (to allow the implementation to select the protocol).
127 For an explanation of the terms used in this section, see
133 Interface Attribute Value
139 T} Thread safety MT-Unsafe
146 4.2BSD, BSD, Solaris.
153 function sends the unencrypted password across the network.
155 The underlying service is considered a big security hole and therefore
156 not enabled on many sites; see