MirBSD manpage: rcmdsh(3)

RCMDSH(3)                  BSD Programmer's Manual                   RCMDSH(3)


     rcmdsh - return a stream to a remote command without superuser


     #include <unistd.h>

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


     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 contain-
     ing 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.


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


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


     The rcmdsh() function first appeared in OpenBSD 2.0.


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

MirBSD #10-current               May 5, 2003                                 1

Generated on 2022-12-24 01:00:14 by $MirOS: src/scripts/roff2htm,v 1.113 2022/12/21 23:14:31 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2022 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.

Kontakt / Impressum & Datenschutzerklärung