Hi,

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

        if (!( pwd = getpwnam ( user ))) {
                log(ERROR,"User %s not known",user);
                stat=NOUSER;
        }
        if (!strcmp( crypt(pass,pwd->pw_name), pwd->pw_passwd) ) {
                log(DEBUG|MISC,"HURRAY : %s authenticated\n", user);
                stat = AUTHED;
                }

The problem is, that my passwords are encrypted in md5-format, so the strcmp 
fails always. Now i did not find any usable information on how to work this out 
on FreeBSD, and how to be independent from the settings in the login-conf ? 
(that i dont have to check whether its using crypt,md5 or blowfish)

The code should be running on 4.x and 5.x

Any ideas ?

Kind regards 

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

Reply via email to