[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Detecting errors in ldap_get_values
Julio Sánchez Fernández wrote:
>
> According to the C API draft, NULL is returned both when no values for
> the attribute type are present in the entry and when some kind of error
> happened. I have seen code in sendmail 8.10.0 that tries to tell which
> is it by calling ldap_get_option with LDAP_OPT_ERROR_NUMBER and checking
> if the returned value is LDAP_SUCCESS.
Well, silly me, it was not ldap_get_values, but ldap_first_entry and
ldap_next_entry.
Still, the question stands and is a general API question: When a function
uses the same return value to indicate data exhaustion and error, a program
making use of that API *must* clear the error number before calling such a
function?
Or should the API implementation set the error number to LDAP_SUCCESS
on all successful calls to such functions?
Which is it? Do I fix OpenLDAP or should I make a patch to send the
sendmail maintainers?
Thanks in advance,
Julio