[ale] getpw()

Asif asife at mindspring.com
Wed Jan 24 05:01:52 EST 2001


I have done something like this on solaris. Apparently, there are two system calls that you can use;

struct passwd *ptr;
ptr = getpwnam(username);
return ptr->pw_passwd;


For shadow passwords try this:

struct spwd *ptr;
ptr = getspnam(username);
return ptr->sp_pwdp;

Hope it helps.

Asif



chrisf at computone.com wrote:

> Is there a function I can use to get the password field from /etc/passwd?
>
> I can use getpw() to get the whole line?  Is there a way to get the field without me cuting the string apart?
>
> Thanks,
>
> Chris
>
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list