 |
Index for Section 3 |
|
 |
Alphabetical listing for R |
|
 |
Bottom of page |
|
rexec(3)
NAME
rexec, rexec_r - Allow command execution on a remote host
SYNOPSIS
#include <netdb.h>
#include <unistd.h>
int rexec(
char **host,
int port,
char *user,
char *passwd,
char *command,
int *err_file_desc );
The following function is supported in order to maintain backward
compatibility with previous versions of the operating system:
int rexec_r(
char **host,
int port,
char *user,
char *passwd,
char *command,
int *err_file_desc,
struct hostent_data *host_data );
LIBRARY
Standard C Library (libc)
PARAMETERS
host
Contains the name of a remote host that is listed in the /etc/hosts
file or /etc/resolv.conffile. If the name of the host is not found in
either file, the rexec() fails.
port
Specifies the well-known Internet port to use for the connection. A
pointer to the structure that contains the necessary port can be
obtained by issuing the following library call:
getservbyname("exec", "tcp")
user
Points to a user ID that is valid on the host.
passwd
Points to the password of the specified user ID on the host.
command
Points to the name of the command to be executed at the remote host.
err_file_desc
Specifies the file to which standard error from the remote command is
sent.
If the err_file_desc parameter is 0 (zero), the standard error of the
remote command is the same as standard output. No provision is made
for sending arbitrary signals to the remote process. In this case,
however, it may be possible to send out-of-band data to the remote
command.
If the err_file_desc parameter is nonzero, an auxiliary channel to a
control process is set up, and a descriptor for it is placed in the
err_file_desc parameter. The control process provides diagnostic output
from the remote command on this channel and also accepts bytes as
signal numbers to be forwarded to the process group of the command.
This diagnostic information does not include remote authorization
failure, since this connection is set up after authorization has been
verified.
host_data
Per-thread data for reentrant version.
DESCRIPTION
The rexec() (remote execution) function allows the calling process to
execute commands on a remote host.
If the rexec() connection succeeds, a socket in the Internet domain of type
SOCK_STREAM is returned to the calling process and is given to the remote
command as standard input and standard output.
The user and passwd parameters specify a valid user ID and the associated
password for that user on the remote host. If the user and passwd
parameters are not supplied, the rexec() function takes the following
actions until finding a user ID and password to send to the remote host:
1. It searches the current environment for the user ID and password on
the remote host.
2. It searches the user's home directory for a file called $HOME/.netrc
that contains a user ID and password.
3. It prompts the user for a user ID and password.
Note that action 3 does not apply when using rexec_r().
NOTES
The rexec_r() function is the reentrant version of rexec(). It is
supported in order to maintain backward compatibility with previous
versions of the operating system. The netdb.h header file defines the
hostent_data structures.
RETURN VALUES
Upon successful completion, the system returns a socket descriptor to the
remote command. Otherwise, a value of -1 is returned, indicating that the
specified hostname does not exist.
FILES
/etc/hosts
Contains hostnames and their addresses for hosts in a network. This
file is used to resolve a hostname into an Internet address.
/etc/resolv.conf
Contains the name server and domain name.
$HOME/.netrc
Contains automatic login information.
SEE ALSO
Functions: getservbyname(3), rcmd(3), rresvport(3), ruserok(3).
Commands: rexecd(8).
 |
Index for Section 3 |
|
 |
Alphabetical listing for R |
|
 |
Top of page |
|