home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_01 / 8n01029a < prev    next >
Text File  |  1990-02-19  |  406b  |  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.