[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldap_search results

At 05:06 PM 1/14/99 -0600, Randy Kunkee wrote:
>In the event that ldap_search returns a -1, how do you get the error code?
>With Netscape SDK, I used the function ldap_get_lderrno(), then translate it
>to a string via ldap_err2string().  In the old Umich code, I just went
>directly into the ldap structure to ld->ld_errno.

OpenLDAP -devel is moving towards the IETF LDAPext C API draft+discussions.
You must use ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &err) and
ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &str).

One noticable difference between our current implementation and the
draft is we require ldap_memfree() to be called on the returned string.
There is good reason to always require returned data to be freed by
the client as was noted in LDAPext discussions.

1.x, of course, uses the U-Mich API.

>OpenLDAP hides this and provides no interface that I can see in the

ldap_get/set_option(3) man page is on my list of things to do...