home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!bcstec!hall
- From: hall@bcstec.ca.boeing.com (Robert J. Hall)
- Newsgroups: comp.sys.apollo
- Subject: Apollo Password Problem
- Message-ID: <3568@bcstec.ca.boeing.com>
- Date: 4 Sep 92 19:00:35 GMT
- Organization: Boeing Computer Services, Seattle
- Lines: 48
-
-
- I'm trying to write a custom screen lock program on the HP/Apollo for
- my group. This program requires the user to enter their correct pass-
- word in order to release the display. The password is then encrypted
- and compared to the encrypted password in /etc/passwd. Unfortunately,
- this method doesn't seem to work consistently on the Apollo. It works
- for some accounts, but not others. I've got a sneaking suspicion that
- it's because the encrypted password in the /etc/passwd file does not
- match the one in the registry.
-
- Has anyone else figured out a workaround, or way to fix this problem?
- Here's a code snippet of the program I'm using to check the password:
-
- ----snip----snip----snip----snip----snip----snip----snip----snip----
-
- extern struct passwd *getpwent();
- struct passwd *pwent;
- unsigned int uid;
- int result;
-
- /* Initialization */
- result = FALSE;
-
- /* Rewind the password file */
- setpwent();
-
- /* Get the UID of this process */
- uid = getuid();
-
- /* Get the account password */
- pwent = getpwuid(uid);
-
- /* Compare the passwords */
- if ( strcmp( pwent->pw_passwd, (char *)crypt( input, pwent->pw_passwd ) ) == 0 )
- result = TRUE;
-
- /* Close the password file */
- endpwent();
-
- ----snip----snip----snip----snip----snip----snip----snip----snip----
-
- The 'input' string is the user's (hidden) password input. Thanks for
- any information you can provide.
-
- --
- Bob Hall, | "If at first you don't succeed, try, try again.
- Workstation Peripheral | Then give up. No use being a damn fool about it."
- Boeing Computer Services | -Groucho Marx
-