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

ldap_search_s SegFaults on Linux



Hey guys,


I'm in a mid-size trouble...

I have a piece of code which just builds a filter fitting my needs and returns that to a function which immediately calls ldap_search_s().

The problem is...I'm getting a segmentation fault on ldap_search_s(). The problem is with the filter but I don't know what is the problem.

If I pass the filter string directly to ldap_search_s(..., "filterstring",...) the code works fine. Also if immediately before I return the filter string, I make a strcpy(filter, "filterstring"), the code will work fine. I just don't understand what's happening there.

My guess is that the problem is with OpenLDAP 1.2.9, it works preety fine.

  Client Profile:

  slackware 8.0
  kernel 2.4.17
  OpenLDAP 1.2.9 and 1.2.13 (tested on both)
  glib 2.2.3

  Server Profile:

  solaris 8
  OpenLDAP 1.2.9

------------------------------

  Boxes Specification

  M1 (client):
    slackware 8.0
    openldap 1.2.13

  M2 (server):
    solaris 7
    openldap 1.2.9

  M3 (client/server)
    solaris 8
    openldap 1.2.13

  M4 (client/server)
    solaris 7
    openldap 1.2.9


Authentication Test Results:

   M1 -> M2 = Error
   M1 -> M3 = OK
   M1 -> M4 = Error
   M3 -> M2 = OK
   M3 -> M3 = OK
   M3 -> M4 = OK
   M4 -> M2 = OK


Finally, my string is about 287 chars long and the buffer dinamically allocated for it is about 45x chars long. The buffer was allocated with calloc().


Do you have any comments on this?? I just cannot change M2 and M3 to OpenLDAP 1.2.13 because they are both production boxes.

  Please, any help is welcome!!!
  Thanks,

William Zanatta

--
Perl combines all of the worst aspects of BASIC, C and line noise.
                -- Keith Packard