--- Lowell Gilbert
<[EMAIL PROTECTED]> wrote:
> getpwent() *does* give you the encrypted password.
> It's the second field in the structure passed back.
> 
Well, i did:
............................................
include<sys/types.h>
#include<pwd.h>

extern int errno;

int main()
{
char *name="dan";
struct passwd *password;
int uid;

password=getpwnam(name);

if(!password)
        {
        perror("getpwnam failed");
        exit(1);
        }

uid=password->pw_uid;

printf("Uid: %d, passwd:
%s\n",uid,password->pw_passwd);

exit(0);
}
.........................................
bash-2.05b$ ./a.out
Uid: 1001, passwd: *
........................................
I get passwd field from /etc/passwd.which
is '*' for every user, not the hash 
from /etc/master.passwd.

Where am i wrong?



                
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to