*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> rcmdsh (3)              
Title
Content
Arch
Section
 

RCMDSH(3)

Contents


NAME    [Toc]    [Back]

     rcmdsh - return a stream to a remote command  without  superuser

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int
     rcmdsh(char **ahost, int inport, const char *locuser,
             const   char   *remuser,   const   char  *cmd,  char
*rshprog);

DESCRIPTION    [Toc]    [Back]

     The rcmdsh() function is used by normal users to  execute  a
command on a
     remote  machine  using an authentication scheme based on reserved port numbers
 using rsh(1) or the value  of  rshprog  (if  non-null).
rshprog may be
     a  fully-qualified  path, a non-qualified command, or a command containing
     space-separated command line arguments.

     The rcmdsh() function looks up the host *ahost  using  gethostbyname(3),
     returning  -1  if the host does not exist.  Otherwise *ahost
is set to the
     standard name of the host and a connection is established to
a server residing
 at the well-known Internet port shell/tcp (or whatever port is
     used by rshprog).  The parameter inport is  ignored;  it  is
only included
     to provide an interface similar to rcmd(3).

     If  the  connection succeeds, a socket in the UNIX domain of
type
     SOCK_STREAM is returned to the caller, and given to the  remote command as
     stdin and stdout, and stderr.

DIAGNOSTICS    [Toc]    [Back]

     The  rcmdsh()  function returns a valid socket descriptor on
success.  It
     returns -1 on error and prints a diagnostic message  on  the
standard error.

SEE ALSO    [Toc]    [Back]

      
      
     rsh(1), socketpair(2), rcmd(3), rshd(8)

HISTORY    [Toc]    [Back]

     The rcmdsh() function first appeared in OpenBSD 2.0.

BUGS    [Toc]    [Back]

     If  rsh(1)  encounters  an error, a file descriptor is still
returned instead
 of -1.

OpenBSD      3.6                            May      5,      2003
[ Back ]
 Similar pages
Name OS Title
rexec IRIX return stream to a remote command
rexec FreeBSD return stream to a remote command
rexec OpenBSD return stream to a remote command
rexec NetBSD return stream to a remote command
iruserok FreeBSD routines for returning a stream to a remote command
rresvport OpenBSD routines for returning a stream to a remote command
rresvport_af NetBSD routines for returning a stream to a remote command
orcmd_af NetBSD routines for returning a stream to a remote command
rcmd IRIX routines for returning a stream to a remote command
rresvport_af OpenBSD routines for returning a stream to a remote command
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service