Simo was studying the dereference code lately and found two issues. #1
is an important bug, #2 is more of a cosmetic issue.
[PATCH 1/2] Use LDAPDerefSpec properly
ldap_create_deref_control_value expects an array of LDAPDerefSpec structures
with LDAPDerefSpec.derefAttr == NULL as a sentinel. We were passing a
single instance of a LDAPDerefSpec structure.
https://fedorahosted.org/sssd/ticket/1050
[PATCH 2/2] Remove confusing do-while loop
The deref processing would return a single control back. The do-while
loop was harmless but confusing.