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

ldap_search_s() return code (ITS#509)



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.

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. 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.

Paul