SYNOPSIS
#include <unistd.h>
int rcmd(char **ahost, int inport, const char *locuser, const char *remuser, const char *cmd, int *fd2p);
int rresvport(int *port);
int ruserok(const char *rhost, int superuser, const char *ruser, const char *luser);
int iruserok(in_addr_t raddr, int superuser, const char *ruser, const char *luser);
DESCRIPTION
The
The
If the connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the caller, and given to the remote command as stdin and stdout. If fd2p is non-null, then an auxiliary channel to a control process will be set up, and a descriptor for it will be placed in that location to which it refers. The control process will return diagnostic output (stderr) from the command on this channel, and also accepts bytes on this channel as being UNIX signal numbers, to be forwarded to the process group of the command. The diagnostic information returned does not include remote authorization failure, as the secondary connection is set up after authorization has been verified. If fd2p is null, then the stderr of the remote command is made the same as the stdout and no provision is made for sending arbitrary signals to the remote process, although you may be able to get its attention by using out-of-band data.
The
The
If this file does not exist, is not a regular file, is owned by anyone
other than the user or the super-user, or is writable by anyone other
than the owner, the check automatically fails.
The
PARAMETERS
- ahost
-
Points to the name of the host to which the connection is made. If the connection is successful, this name is updated with the standard name for the host.
- inport
-
Is the Internet port number on which the connection should be attempted.
- locuser
-
Is the user name on the local system.
- remuser
-
Is the user name to use for authentication on the remote system.
- cmd
-
Is the command to be executed on the remote host.
- fd2p
-
If non-null, a second connection is made to stderr of the remote command, and the file descriptor is returned through this pointer. If null, stderr of the remote command is connected to its stdout.
- port
-
Points to a port number to which an attempt is made to bind. This port number is updated to specify the last port number attempted.
- rhost
-
Is the name of the remote host for which authentication is requested.
- raddr
-
Is the address of remote host for which authentication is requested.
- superuser
-
Is a boolean flag indicating whether the local user is to be considered the super-user.
- ruser
-
Is the name of the remote user.
- luser
-
Is the name of the local user.
RETURN VALUES
On success,
On success,
On success,
CONFORMANCE
4.4BSD
MULTITHREAD SAFETY LEVEL
Unsafe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
bind() ,gethostbyname() ,gethostname() ,rexec() ,socket()
PTC MKS Toolkit 10.5 Documentation Build 40.