RCMDSH(3)
β¨ NAME β¨
okay bestie, welcome to RCMDSH(3) from the Library Functions Manual β the page for rcmdsh: return a stream to a remote command without superuser.
πΈ SYNOPSIS πΈ
#include <unistd.h>
int
rcmdsh(char **ahost, int inport, const char *locuser,
const char *remuser, const char *cmd, const char *rshprog);
π¦ DESCRIPTION π¦
So like, 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 rshd(8) or the value of rshprog (if it's non-NULL). iconic behavior, honestly β¨
First it looks up the host *ahost using gethostbyname(3), and returns -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 way that hostname lookup happens first is so real π«Ά
Ngl, the inport argument is ignored β it is only included to provide an interface similar to rcmd(3). not me being decorative but still in the signature π
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, stdout, and stderr. three streams, one socket, main character energy π
π RETURN VALUES π
The rcmdsh() function returns a valid socket descriptor on success. Otherwise, -1 is returned and a diagnostic message is printed on the standard error. periodt π
π SEE ALSO π
the whole see-also coven: rsh(1), socketpair(2), rcmd(3), rshd(8) β go read those too, bestie π β¨
π HISTORY π
The rcmdsh() function first appeared in OpenBSD 2.0, and made its way into FreeBSD 4.6. a little cross-platform glow-up moment π¦
π BUGS π
π¨ bug alert: Ifrsh(1)encounters an error, a file descriptor is still returned instead of-1. that is not the vibe, but it is literally what the page says π
muah π this page is from Debian, dated September 1, 1996, and its manual name is RCMDSH(3) β go be iconic, bestie π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms