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

strange problem



I'm successfully using mod_ldap on hosing system, with FreeBSD 4.8 and proftpd 1.2.9, OpenLDAP 2.0.23; however, I've got problems on 5.3/1.3.0/2.2.19.

Problem is QUITE strange. 

=== cut here code example ===
#include <stdio.h>
#include <ldap.h>
#include <errno.h>

main()
{
  int ret;
  LDAP * ld;
  char * ldap_server="127.0.0.1";
  char * ldap_dn = "cn=Manager,dc=titl,dc=ru";
  char * ldap_dnpass = "password";
  if ((ld = ldap_init(ldap_server, LDAP_PORT)) == NULL) {
    printf("mod_ldap: pr_ldap_connect(): ldap_init() to %s failed: %s", ldap_server, strerror(errno));
    return -1;
  }
  if ((ret = ldap_simple_bind_s(ld, ldap_dn, ldap_dnpass) != LDAP_SUCCESS)) {
    printf("mod_ldap: pr_ldap_connect(): ldap_simple_bind() to %s as %s:%s failed (%d): %s", ldap_server, ldap_dn, ldap_dnpass, ret, ldap_err2string(ret));
    return -1;
  }

}
=== cut here ===

With either correct or incorrect password, I get error 1 on ldap_simple_bind_s: "Operations error".

On the working box, with dn "cn=Manager,o=Sub Service" and correct password, the code works quite fine.

rootdn is correct, checked several times.

What could I've done wrong?...


-- 
Alex.