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

(ITS#6386) Usage of ldap_init_fd



Full_Name: Vitaly 
Version: 2.4.16
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (192.115.180.11)


I try to use function ldap_init_fd, but it fails .

               
ldap_init_fd (sockfd  , 1 ,host_uri , &server);

...
    rc = ldap_simple_bind_s(server, bind_dn, password);
    if (rc != 0) {
        fprintf(stderr, "ldap_simple_bind_s: %s", (*ldap_err2string)(rc));
        return 1;
    }

    rc = ldap_search_s(server, ludp->lud_dn, ludp->lud_scope,
             ludp->lud_filter, ludp->lud_attrs, 0, &result);

...
 fails with segmentation fault:

#0  find_connection (ld=0x8073ae8, srv=0x807cd50, any=1) at request.c:629
#1  0x080571ba in ldap_chase_referrals (ld=0x8073a08, lr=0x807cc98,
    errstrp=0x807ccbc, sref=-1, hadrefp=0xbffff84c) at request.c:1356
#2  0x0804c620 in try_read1msg (ld=0x8073a08, msgid=2, all=1,
lc=0x8073ae8,
    result=0x8071ce0) at result.c:805
#3  0x0804bab0 in wait4msg (ld=0x8073a08, msgid=2, all=1,
timeout=0x8073ae8,
    result=0x8071ce0) at result.c:390
#4  0x0804dc5e in ldap_search_s (ld=0x8073a08, base=0x8071d80 "cn=US",
    scope=0, filter=0x0, attrs=0x0, attrsonly=0, res=0x8071ce0) at
search.c:428
#5  0x0804ab38 in main (argc=3, argv=0xbffff9d0) at /tmp/get.c:182
(gdb) p lc
$1 = (struct ldap_conn *) 0x8073ae8
(gdb) p *lc
$2 = {lconn_sb = 0x807bb30, lconn_refcnt = 3, lconn_created = 0,
  lconn_lastused = 1258722436, lconn_rebind_inprogress = 0,
  lconn_rebind_queue = 0x0, lconn_status = 3, lconn_server = 0x0,
  lconn_ber = 0x0, lconn_next = 0x0}
(gdb)  quit