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

RE: How to get error response text?



> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Dieter
> Kluenter
> Sent: Thursday, March 25, 2004 12:00 AM
> To: openldap-software@OpenLDAP.org
> Subject: Re: How to get error response text?
>
>
> Thomas Gagné <tgagne@wideopenwest.com> writes:
>
> > I've noticed in network traces that an error number is
> returned, like
> > "server unwilling to perform" but the message also includes
> some text,
> > like "use bind to verify old password".  Where can I find that text?
> [...]
>
> ldap.h

ldap.h lists the standard meanings of LDAP result codes. If you want to get
the additional error text that accompanies an LDAP result message, you should
call ldap_parse_result() on the result message. If you used a synchronous
libldap call, then you didn't get the result message returned to you. In this
case, you can use ldap_get_option() with the LDAP_OPT_ERROR_STRING selector.
This approach is not reliable if your app is multithreaded and you have
multiple operations going on on the same LDAP* handle though; in that case
you should avoid using the synchronous calls, and always use
ldap_parse_result().

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support