site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hello, Since new users are not added to /etc/passwd I doubted that the standard C password functions would work. I thought I'd have to use Apple's fancy pants APIs. getpwent worked just fine. Thanks, vitale On Fri, 2005-07-15 at 13:21 -0700, Jason Townsend wrote:
On Jul 15, 2005, at 12:20 PM, Finlay Dobbie wrote:
On 7/15/05, Chris Vitale <cvitale@trustednetworktech.com> wrote:
I need to find all users and UIDs on a local system from a daemon. I'd like to use the netinfo API (rather than command line tools) but I can't locate netinfo/ni.h on my local machine or in an SDK on the apple site. What am I missing?
The NetInfo API is deprecated and not supported. Don't use it.
The recommended replacement is the Open Directory (né Directory Services) API.
If all you need is to get a list of the users and UIDs, then you can probably get away with just using getpwent().
Open Directory API documentation is here:
http://developer.apple.com/documentation/Networking/Conceptual/ Open_Directory/
It's often not necessary to do an exhaustive enumeration... if you could explain why you want to do that there might be a more efficient approach that would scale better in situations where there are thousands or hundreds of thousands of users.
-Jason
Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com