FreeBSD auth

Dan Toganel dantoganelus at yahoo.com
Wed Nov 2 01:57:18 PST 2005


Hello list, 
I'm a newbie in freebsd programming and i need some
docs & hints in order to port a program from linux to
FreeBSD.

The piece of code is:
..............................................
struct spwd* shadow=getspnam(name);
if(!shadow)
    {
    .....
    }
char *key=crypt(passwd,shadow->sp_pwdp);
if(!key)
        {
        ....
        }
if(strncmp(shadow->sp_pwdp,key,strlen(shadow->sp_pwdp))==0)
    {
    /*login success*/
    }
else
    {
    /*login failed*/
    }
........................................
I realize that in FreeBSD master.passwd is the
replacement for linux shadow file.
Is there a function to parse it?
And how can i obtain the hash string?
Thanks in advance for any help.



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


More information about the freebsd-questions mailing list