[EMAIL PROTECTED] wrote:
Hi,

i am trying to validate a given user password against my local passwd-file with this piece of code :

if (!strcmp( crypt(pass,pwd->pw_name), pwd->pw_passwd) ) {

The second argument to crypt here should be pwd->pw_passwd. Otherwise, this doesn't work even with DES-encrypted passwords. The first part of any encrypted password is the 'salt', which effectively indicates how that password is encrypted. You need to give the encrypted password to crypt so it knows which encryption to use for the plaintext.

Tim Kientzle



_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to