HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)

r
rexec(3N) rexec(3N)
int argc;
{
char ch;
struct servent *servent;
FILE *fp;
int sd;
servent = getservbyname("exec", "tcp");
sd = rexec(host, servent->s_port, user, passwd, cmd, 0);
fp = fdopen(sd, "r");
while ((ch = getc(fp)) != EOF)
putchar(ch);
}
WARNINGS
There is no way to specify options to the
socket() call that rexec() makes.
A program using
rexec() should not be put in the background when
rexec() is expected to prompt for
a password or user name. Putting
rexec() in the background will cause it to compete with the current
shell process for input.
Since rexec() replaces the pointer to the host name (*ahost) with a pointer to the standard name of the
host in a static data area, this value must be copied into the user’s data area if it is to be used later.
The password is sent unencrypted through the socket connection.
AUTHOR
rexec() was developed by the University of California, Berkeley.
SEE ALSO
remsh(1), inetd(1M), rexecd(1M), gethostent(3N), getservent(3N), rcmd(3N), netrc(4).
294 Hewlett-Packard Company 3 HP-UX 11i Version 3: February 2007