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

Re: ldap_search_s() return code (ITS#509)



At 07:30 AM 4/20/00 GMT, paulcun@sco.com wrote:
>Full_Name: Paul Cunningham
>Version: ldapopen-2_0-alpha3
>OS: Linux
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (150.126.24.200)
>
>
>LDAP V3 (alpha 3)
>
>error code returned by ldap_search_s() is wrong.

ldap_search or ldap_search_s ?  I'll assume your report
is in regards to ldap_search per your provided code
fragment.

>When an object does not exist in the DIT, and you try to do a
>ldap_search_s() on it the returned error code is wrong even though
>the code returned by ldap_get_option( ld, ERROR_NUMBER) and by 
>ldap_perror() is correct.
>
>eg.
>
>  res = ldap_search( ld, "deviceid=printer1,ou=ou1,o=superted", 
>                     LDAP_SCOPE_BASE, "objectclass=*", attrs,
>                     FALSE, &result);
>
>  if the object does not exist the value returned in "res" is not
>  32 (X'20') LDAP_ERR_NO_SUCH_OBJECT.

ldap_search() should NEVER return NoSuchObject as ldap_search
doesn't wait for the server result.  The value of ldap_get_option()
is likely associated with the previous result obtained from the
server (via ldap_result() or an sync call).

>	The actual value returned seems
>  to vary depending on the program its called in - to check I modified 
>  lsapsearch.c to use ldap_search_s(), it returned 2.
>
>This looks like a fault - is it a known fault - I know its only alpha code.

If the problem you see is truely with ldap_search_s(), please
resubmit ITS with an exact code fragment of your usage.

Kurt