Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/ruserok.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/ruserok.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/ruserok.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/ruserok.html on line 8
Check the identity of a remote host
#include <unistd.h>
int ruserok( char * rhost,
int superuser,
char * ruser,
char * luser );
- rhost
- The name of the remote host, as returned by
gethostbyaddr().
- superuser
- Nonzero if the local user is the superuser, zero otherwise.
- ruser
- The name of the remote user.
- luser
- The name of the local user.
libsocket
Use the -l socket option to
qcc
to link against this library.
The ruserok() routine checks the identity of a remote host.
It's used by servers to authenticate clients requesting service with
rcmd().
The rcmd(),
rresvport(),
and
ruserok() functions
are used by the
rshd server
(see the Utilities Reference), among others.
The ruserok() function takes a remote host's name
(as returned by the gethostbyaddr() routine), two
user names, and a flag indicating whether the local user's
name is that of the superuser.
Then, if the user isn't the superuser, it checks the file
/etc/hosts.equiv
(described in the Utilities Reference).
If that lookup isn't done, or is unsuccessful, the
.rhosts file in the local user's home
directory is checked to see if the request for service is
allowed. If this file is owned by anyone other than the user
or the superuser, or if it's writable by anyone other than
the owner, the check automatically fails.
If the local domain obtained from
gethostname()
is the same as the remote domain, only the machine name need
be specified.
- 0
- The machine name is listed in the hosts.equiv
file, or the host and remote username were found in the
.rhosts file.
- -1
- An error occurred (errno is set).
The error code EAGAIN is
overloaded to mean “All network ports in use.”
Unix
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
gethostbyaddr(),
gethostname(),
iruserok(),
iruserok_sa(),
rcmd(),
rresvport()
/etc/hosts.equiv,
rshd
in the Utilities Reference
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/ruserok.html on line 189
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/ruserok.html on line 189