Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rexec(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rcmd, rresvport, ruserok



REXEC(3,L)                  AIX Technical Reference                  REXEC(3,L)



-------------------------------------------------------------------------------
rexec



PURPOSE

Allows command execution on a remote Internet host.

LIBRARY

Internet Library (libc.a)

SYNTAX

int rexec (host, port, user, passwd, command, errfdp)

char **host;
int port;
char *user, *passwd, *command;
int *errfdp

DESCRIPTION

The rexec subroutine allows the calling process to execute commands on a remote
host which usually is outside your TCF cluster.

The rexec subroutine uses the gethostbyname subroutine to find the host
specified by host.  *host is updated to point to the standard name of the host
found by gethostbyname.  If the host does not exist, the rexec subroutine fails
and returns -1.

The port parameter specifies the well-known DARPA Internet port to use for the
connection.  A pointer to the structure that contains the necessary port can be
obtained by issuing the following call:

      getservbyname("exec", "tcp")

The protocol for the connection is described in detail in the discussion of
rexecd in AIX TCP/IP User's Guide.

The user and passwd parameters point to a user ID and password valid at the
host.  If these parameters are not supplied, the rexec subroutine takes the
following actions until finding a user ID and password to send to the remote
host:

  1. Searches the current environment for the user ID and password on the
    remote host.

  2. Searches the user's home directory for a file called .netrc that contains
    a user ID and password.




Processed November 7, 1990        REXEC(3,L)                                  1





REXEC(3,L)                  AIX Technical Reference                  REXEC(3,L)



  3. Prompts the user for a user ID and password.

The command parameter points to the name of the command to be executed at the
remote host.

If the 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.

If errfdp is not 0, an auxiliary channel to a control process is set up, and a
descriptor for it is placed in *errfdp.  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.

If errfdp is 0, then the standard error of the remote command is the same as
standard output, and 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.

RETURN VALUE

The rexec subroutine fails and a value of -1 is returned if the specified host
name does not exist.

RELATED INFORMATION

In this book:  "rcmd, rresvport, ruserok."

The discussion of rexecd and /etc/hosts in AIX TCP/IP User's Guide.
























Processed November 7, 1990        REXEC(3,L)                                  2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026