Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Search via email address in cachingappleopendirectory fails #267
ebach2@… originally submitted this as ticket:335
Using trunk/head, with users in opendirectory, ldap set to /127.0.0.1 instead of /Search, with iCal from 10.5.6, if I connect as user 'dave', and create an event inviting user 'sarah@…', iCal will auto-complete the name fine and pass the email address to DCS.
However, in the case where the cache misses (user sarah hasn't connected since the server was last started), it does an OD search for sarah@…, which fails to find the user (there is a user with that address in emailaddress, verified both with a DS dumping tool I wrote and in Directory.app). However, if I first make sure that user sarah has connected, then her info gets loaded into the cache, and she is properly invited to the event.
ebach2@… originally submitted this as comment:2:ticket:335
Replying to ebach2@…:
To follow up, in cachingappleopendirectory.OpenDirectoryService.queryDirectory(), it catches an exception from the query:
[I added this debug line]
When I re-rerun everything, this logs: 2009-04-26 13:35:45-0700 [-] [caldav-8010] [-] [twistedcaldav.directory.cachingappleopendirectory.OpenDirectoryService#debug] opendirectory.queryDirectory unsupported attribute on record - don't fail -14200
ebach2@… originally submitted this as comment:3:ticket:335
To follow up, it also fails even when using /Search for the ldap node.
But within the dscl cli tool, the search for the email address succeeds:
Users/sarah dsAttrTypeNative:mail = (
ebach2@… originally submitted this as comment:5:ticket:335
Replying to ebach2@…:
I'm not sure why, but:
search /Search dsAttrTypeStandard:EMailAddress sarah@…
returns no entries (where searching for dsAttrTypeNative:mail returns the proper record)
But my DirectoryServices exploring app (which just does a dsGetRecordEntry, then iterates over all the attributes for the record), returns both dsAttrTypeNative:mail and dsAttrTypeStandard:EMailAddress entries, which the dscl tool doesn't display. And I've verified in DirectoryUtility.app that EMailAddress is mapped by the mail ldap attribute.
ebach2@… originally submitted this as comment:6:ticket:335
And doing read /Search/Users/Sarah shows both
dsAttrTypeNative:mail: sarah@… EMailAddress: sarah@…
search /Search EMailAddress sarah@… also returns no results
and the wiki seems to strip off the 'test.com' from everywhere that you would expect the email address to be in the search commands
Thanks for looking into this. What I found was that our pyopendirectory queries are coming back empty when we do a search on email address and ask for users, groups, resource, and locations. If we only look for users and groups, the query works. I have updated trunk with this workaround.