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

Re: Detecting errors in ldap_get_values



Julio,

The current draft is somewhat unclear as to the behavior of
LDAP_OPT_ERROR_NUMBER, however it does describe the value as:
       The code of the most recent LDAP error that
	occurred for this session

Also, each of the routines that return NULL say something like:

	ldap_first/next_XXX will return NULL when no more XXX
	exist in the result set to be returned.  NULL is also 
	returned if an error occurs while stepping through the
	entries, in which case the error parameters in the
	session handle ld will be set to indicate the error.

Given these statements, I believe it inappropriate for an API
to set LDAP_OPT_ERROR_NUMBER unless an API error has occurred.
So, much like POSIX errno, I believe the caller has the
responsibility to clear past error codes.

The document should avoid the term "LDAP error" and, instead
use "LDAP resultCode" and "API error code".  The latter being
described as being LDAP resultCodes which are reserved by 
for API use.

At 12:15 PM 3/22/00 +0100, Julio Sánchez Fernández wrote:
>Do I fix OpenLDAP or should I make a patch to send the
>sendmail maintainers?

<<insert disclaimer concerning early adoptation of I-D>>

I suggest applications experimenting with implementations
of LDAP C APIs clear LDAP_OPT_ERROR_NUMBER.