Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rcmd(3N) — GL1 W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rlogin(1C)

rsh(1C)

rlogind(1M)

rshd(1M)

RCMD(3N)  —  Silicon Graphics

NAME

rcmd, rresvport, ruserok - routines for returning a stream to a remote command

SYNOPSIS

rem = rcmd(ahost, inport, locuser,
      remuser, cmd, fd2p);
char **ahost;
int inport;
char *locuser, *remuser, *cmd;
int *fd2p;
s = rresvport(options);
int options;
ruserok(rhost, ruser, luser);
char *rhost;
char *user, *luser;

DESCRIPTION

Rcmd executes a command on a remote machine.  It uses an authentication scheme based on reserved port numbers.  Only the superuser can use this command.  rresvport returns a descriptor with an address in the priviliged port space to a socket.  ruserok authenticates clients requesting service with rcmd.  All three functions are in the same file.  rshd(1M) and other servers use these functions. 

Rcmd looks up the host *ahost. It returns -1 if the host does not exist. Otherwise *ahost becomes the standard name of the host and a connection is established to a server residing at the well-known Internet port inport. 

If the call succeeds, a SOCK_STREAM type socket is returned to the caller, and then given to the remote command as stdin and stdout.  This socket has the options specified in socket(3N).  If fd2p is non-zero, then an auxiliary channel to a control process is set up and a descriptor for it is placed in *fd2p.  The control process returns diagnostic output from the command (unit2) and accepts bytes (as UNIX signal numbers) for forwarding to the command’s process group on this channel.  If fd2p is 0, the stderr (unit 2 of the remote command) becomes the stdout and arbitrary signals cannot be sent to the remote process. 

See rshd(1M) for more details. 

Rresvport obtains a socket with a privileged address bound to it.  Rcmd and other routines use this socket.  Privileged addresses consist of a port in the range 0 to 1023.  Only the superuser can bind a privileged address to this socket. 

ruserok uses the remote host’s name and two user names.  Then it checks the files /etc/hosts.equiv and .rhosts in the current working directory (the local user’s home directory) to see if the service request is allowed.  It returns a 1 if the hosts.equiv file has the machine name or the .rhosts file has the remote user name.  Otherwise ruserok returns a 0. 

FILES

/usr/src</EXOS/src/bin/netser/rcmd.c

SEE ALSO

rlogin(1C), rsh(1C), rlogind(1M), rshd(1M)

Version 2.3  —  July 04, 1985

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