The Guru College

iPhone 3.0 LDAP Search Crashing – An Exploration

I updated to the new iPhone 3.0 OS last night. I had forgotten until this morning the feature I was most looking forward to was now on my phone – the ability to add an LDAP server to the Contacts application. So, I loaded the server we have here on campus, and tried a search. Yay, it returns matches! It even waits for you to stop typing and will bring a list back, which you can then refine by adding more search terms. This is exactly what I wanted. I then tapped on an entry to see what the contact card would look like.

And the Contacts application died. Just went back to the home page of apps. No error, no warning. Just dead.

Luckily, I have admin rights on the LDAP servers. So I bounce over, and look through the logs for my searches. And there they are. So I extract the iPhone search, and run it manually:

ldapsearch -x -h <em>ldap.example.com</em> \<br /> -b <em>ou=people,dc=example,dc=com</em> \<br /> "(|(givenName=<em>username</em>*)(sn=<em>username</em>*) \<br /> (cn=<em>username</em>*)(mail=<em>username</em>*))" \<br /> givenName sn cn mail telephoneNumber \<br /> facsimileTelephoneNumber o title ou \<br /> buildingName street l st postalCode \<br /> c jpegPhoto mobile co pager \<br /> destinationIndicator labeledURI IMHandle \<br /> homePhone postalAddress homePostalAddress

(Server, search base, and test username excluded to protect the innocent). The search returns swimmingly – and, according to the logs, this is what the server gave back to the iPhone. I run the search myself, and save the output, trying to see if something is out of place. Nothing looks wrong – so I hit another entry, for a student this time – an it works. Weird. Some people’s entries are causing the app to crash. I start looking up entries, and comparing fields. This isn’t the fastest process, as often the app will crash out from under my fingers. Finally, I get the problem field isolated:

IMHandle: AIM:<em>username</em>

Any entry with an IMHandle attribute kills the application, so far. This is valid for AIM: and jabber: entries. Next up – start modifying data and see if it’s a format problem for the attr, or if the iPhone just can’t handle it at all. And if it can’t handle it, why is it asking for it?

We’ll find out soon.

Write a little, every night | Home | Children’s Clothing