site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com From: Stephane Sudre <ssudre@intego.com> Well, I was using getpwent in a software too and for one user (not a user account, a real user), it would not work (the accounts were on a Windows server IIRC). Was that the problem, or was it something else? -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... Le 11 mars 05, à 14:42, Chuck Gagnon a écrit : It makes use of getpwent from libc, I would hope there is a backend bridge to DirectoryServices just like there is to NIS as such, perhaps I'm wrong there. My account which is not in /etc/passwd shows up in the list it. if the libc functions are to be abandon in favor of an API then all the BSD tools that make use of them (users, groups, who...) will need to be retooled. With the DirectoryServices, it worked. In some cases it may not be possible to iterate over all users like this due to scale reasons. For example, many LDAP servers limit query results to 500 records, so if there are thousands of users in the server you won't get all of them. If you instead do a getpwnam() which is an exact match lookup those users should show up. Going through the Directory Services APIs allows you to do searches that will translate into the equivalent LDAP search, while calling getpwent() over and over and filtering the results will not. This email sent to site_archiver@lists.apple.com
participants (1)
-
Jason Townsend