site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On samedi, mars 12, 2005, at 12:13 AM, Jason Townsend wrote: 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). Sample was showing a hang in getpw: --------------8<----------------8<--------------8<------------------- --------------8<----------------8<--------------8<------------------- _______________________________________________ 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. Was that the problem, or was it something else? Analysis of sampling pid 795 every 10.000000 milliseconds Call graph: 98 Thread_0e0b 98 start 98 _start 98 NSApplicationMain 98 +[NSBundle(NSNibLoading) loadNibNamed:owner:] 98 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] 98 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] 98 old_loadNib 98 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] 98 -[NSSet makeObjectsPerformSelector:] 98 -[xxxxxxxxxxxxxxxxxxxx awakeFromNib] 98 getpw 98 getpw_internal 98 lu_getpwent 98 _lookup_all 98 _lookup_all_secure 98 mach_msg 98 mach_msg_trap 98 mach_msg_trap The Server was a Windows OS running ActiveDirectory. On the Mac, ADmitMac was running. My $0.02 This email sent to site_archiver@lists.apple.com
participants (1)
-
Stéphane Sudre