Re: How to get encrypted user password
Re: How to get encrypted user password
- Subject: Re: How to get encrypted user password
- From: "Stephen J. Butler" <email@hidden>
- Date: Tue, 29 Dec 2009 20:57:28 -0600
On Tue, Dec 29, 2009 at 8:21 PM, Roger Pau Monné <email@hidden> wrote:
> Hello, I'm implementing a very simple FTP client, and to do the login I
> would like to check against system users instead of using my own database,
> so that I can give the proper permissions to the newly created process that
> I've spawned with fork. What's the best way for doing this in C? I've read
> about the getpwnam function, that returns a struct passwd that has the field
> pw_passwd to compare against (using the crypt function), but this field only
> contains asterisks in Mac OS X and an x in Linux. Is there any common way to
> get the encrypted password of a user across POSIX systems?
In modern security architectures you don't ever handle (or even have
access to) the password in your program. What you do is pass the
credentials (user and password in this case) to some authentication
framework. For OS X and Linux, the best solution is PAM:
<http://www.kernel.org/pub/linux/libs/pam/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden