home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib6 / v_08_01 / 8n01029a < prev    next >
Encoding:
Text File  |  1995-11-01  |  406 b   |  21 lines

  1.  
  2. Listing 1
  3.  
  4. /* read username and lookup info */
  5. getuser()
  6. {
  7.         gets(user);
  8.         if (0 == (pwent = getpwent(user))) {
  9. 
  10.                 ... complain about illegal user ...
  11.                 ... exit 
  12.         }
  13.  
  14. /* read and test password */
  15. getpass()
  16. {
  17.         gets(password);
  18.         if (strcmp(user,"anonymous") == 0 ||
  19.             strcmp(encrypt(password),pwent->pwd) == 0) ...
  20.  
  21.