home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / compat / __old__validuser.c next >
Encoding:
C/C++ Source or Header  |  1994-09-16  |  497 b   |  24 lines

  1. #include "../inet/inetprivate.h"
  2.  
  3. int __ivaliduser(FILE *hostf, u_long raddr, const char *luser,
  4.          const char *ruser);
  5.  
  6.  
  7. int
  8. _validuser(FILE *hostf, const char *rhost, const char *luser,
  9.         const char *ruser, int baselen)
  10. {
  11.     struct hostent *hp;
  12.     u_long addr;
  13.     char **ap;
  14.  
  15.     if ((hp = gethostbyname(rhost)) == NULL)
  16.         return (-1);
  17.     for (ap = hp->h_addr_list; *ap; ++ap) {
  18.         bcopy(*ap, &addr, sizeof(addr));
  19.         if (__ivaliduser(hostf, addr, luser, ruser) == 0)
  20.             return (0);
  21.     }
  22.     return (-1);
  23. }
  24.