When the -r option is enabled, if there is no password specified on the RSH command from the client, z/OS® UNIX RSHD will drive the installation exit. When the installation exit is driven, RSHD looks for a program in /usr/sbin named ruserok. This is the only name that it will look for. If /usr/sbin/ruserok is not found, the request will fail.
When the z/OS UNIX RSHD server invokes /user/sbin/ruserok, it will pass parameters in the following order:
int main(argc, argv)
int argc;
char *argv[];
char *rhost1; /* "hostname" or "hostname.domain" of client
obtained by caller:
gethostbyaddr(getpeername()) or the host
ip address used by the gethostbyaddr if
it failed to return a "hostname" */
int locuid; /* uid of the user name on local system */
char *cliuname; /* user name on client's system */
char *servuname; /* user name on this (server's) system */
int rc = 4;
rhost1 = argv[1];
locuid = atoi(argv[2]);
cliuname = argv[3];
servuname = argv[4];
.
<authenticate user and set rc=0 if valid>
.
return(rc);