home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / apollo / 3468 next >
Encoding:
Text File  |  1992-09-07  |  1.8 KB  |  58 lines

  1. Path: sparky!uunet!bcstec!hall
  2. From: hall@bcstec.ca.boeing.com (Robert J. Hall)
  3. Newsgroups: comp.sys.apollo
  4. Subject: Apollo Password Problem
  5. Message-ID: <3568@bcstec.ca.boeing.com>
  6. Date: 4 Sep 92 19:00:35 GMT
  7. Organization: Boeing Computer Services, Seattle
  8. Lines: 48
  9.  
  10.  
  11. I'm trying to write a custom screen lock program on the HP/Apollo for
  12. my group. This program requires the user to enter their correct pass-
  13. word in order to release the display. The password is then encrypted
  14. and compared to the encrypted password in /etc/passwd. Unfortunately,
  15. this method doesn't seem to work consistently on the Apollo. It works
  16. for some accounts, but not others. I've got a sneaking suspicion that
  17. it's because the encrypted password in the /etc/passwd file does not
  18. match the one in the registry.
  19.  
  20. Has anyone else figured out a workaround, or way to fix this problem?
  21. Here's a code snippet of the program I'm using to check the password:
  22.  
  23. ----snip----snip----snip----snip----snip----snip----snip----snip----
  24.  
  25.     extern struct passwd *getpwent();
  26.     struct passwd *pwent;
  27.     unsigned int uid;
  28.     int result;
  29.  
  30.     /* Initialization */
  31.     result = FALSE;
  32.  
  33.     /* Rewind the password file */
  34.     setpwent();
  35.  
  36.     /* Get the UID of this process */
  37.     uid = getuid();
  38.  
  39.     /* Get the account password */
  40.     pwent = getpwuid(uid);
  41.  
  42.     /* Compare the passwords */
  43.     if ( strcmp( pwent->pw_passwd, (char *)crypt( input, pwent->pw_passwd ) ) == 0 )
  44.         result = TRUE;
  45.  
  46.     /* Close the password file */
  47.     endpwent();
  48.  
  49. ----snip----snip----snip----snip----snip----snip----snip----snip----
  50.  
  51. The 'input' string is the user's (hidden) password input. Thanks for
  52. any information you can provide.
  53.  
  54. -- 
  55.  Bob Hall,                 | "If at first you don't succeed, try, try again.
  56.  Workstation Peripheral    | Then give up. No use being a damn fool about it."
  57.  Boeing Computer Services  |                                     -Groucho Marx
  58.