
japhy
Enthusiast
Mar 8, 2000, 6:37 AM
Post #2 of 3
(361 views)
|
|
Re: password verification problem
[In reply to]
|
Can't Post
|
|
If you want to find out a the entry for a user's password in a the system's /etc/passwd file, use the getpwnam() function: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> @data = getpwnam($username); # or, to specifically get the password $password = (getpwnam($username))[1]; </pre><HR></BLOCKQUOTE> Note: passwords are encrypted and cannot be decrypted. This is A Good Thing. The documentation on the crypt() function tells you how to check if a guess at the password is the right guess. I think I'll get to work on an article for The Learning Center on how to interact with system password files, and how to properly use crypt(), etc.
|