|
|
1.1 root 1: .\" Copyright (c) 1983 The Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms are permitted provided
5: .\" that: (1) source distributions retain this entire copyright notice and
6: .\" comment, and (2) distributions including binaries display the following
7: .\" acknowledgement: ``This product includes software developed by the
8: .\" University of California, Berkeley and its contributors'' in the
9: .\" documentation or other materials provided with the distribution and in
10: .\" all advertising materials mentioning features or use of this software.
11: .\" Neither the name of the University nor the names of its contributors may
12: .\" be used to endorse or promote products derived from this software without
13: .\" specific prior written permission.
14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17: .\"
18: .\" @(#)rexec.3 6.8 (Berkeley) 6/23/90
19: .\"
20: .TH REXEC 3 "June 23, 1990"
21: .UC 5
22: .SH NAME
23: rexec \- return stream to a remote command
24: .SH SYNOPSIS
25: .nf
26: .PP
27: .B "rem = rexec(ahost, inport, user, passwd, cmd, fd2p);"
28: .B char **ahost;
29: .B int inport;
30: .B "char *user, *passwd, *cmd;"
31: .B int *fd2p;
32: .fi
33: .SH DESCRIPTION
34: .ft B
35: This interface is obsoleted by krcmd(3).
36: .br
37: It is available from the compatibility library, libcompat.
38: .ft R
39: .PP
40: .I Rexec
41: looks up the host
42: .I *ahost
43: using
44: .IR gethostbyname (3),
45: returning \-1 if the host does not exist.
46: Otherwise
47: .I *ahost
48: is set to the standard name of the host.
49: If a username and password are both specified, then these
50: are used to authenticate to the foreign host; otherwise
51: the environment and then the user's
52: .I .netrc
53: file in his
54: home directory are searched for appropriate information.
55: If all this fails, the user is prompted for the information.
56: .PP
57: The port
58: .I inport
59: specifies which well-known DARPA Internet port to use for
60: the connection; the call ``getservbyname("exec", "tcp")'' (see
61: .IR getservent (3))
62: will return a pointer to a structure, which contains the
63: necessary port.
64: The protocol for connection is described in detail in
65: .IR rexecd (8).
66: .PP
67: If the connection succeeds,
68: a socket in the Internet domain of type SOCK_STREAM is returned to
69: the caller, and given to the remote command as
70: .B stdin
71: and
72: .BR stdout .
73: If
74: .I fd2p
75: is non-zero, then an auxiliary channel to a control
76: process will be setup, and a descriptor for it will be placed
77: in
78: .IR *fd2p .
79: The control process will return diagnostic
80: output from the command (unit 2) on this channel, and will also
81: accept bytes on this channel as being UNIX signal numbers, to be
82: forwarded to the process group of the command. The diagnostic
83: information returned does not include remote authorization failure,
84: as the secondary connection is set up after authorization has been
85: verified.
86: If
87: .I fd2p
88: is 0, then the
89: .B stderr
90: (unit 2 of the remote
91: command) will be made the same as the
92: .B stdout
93: and no
94: provision is made for sending arbitrary signals to the remote process,
95: although you may be able to get its attention by using out-of-band data.
96: .SH SEE ALSO
97: rcmd(3), rexecd(8)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.