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

BIND problem



Hi ml,

I'm using this little program:

 #include <lber.h>
 #include <ldap.h>
 #include <stdio.h>

 /* cc -o testsb testsb.c -lldap -llber */
 int main(int argc, char *argv[])
 {
   LDAP *ldap;
   int status;

   ldap = ldap_init("127.0.0.1", LDAP_PORT);
   if (!ldap) {
     fprintf(stderr, "ldap_init failed\n");
     exit(1);
   }
   status = ldap_simple_bind_s(ldap,
       "uid=druid,ou=people,DC=domain,DC=IT",
       "password");
//   status = ldap_simple_bind_s(ldap,NULL,NULL);
   if (status !=LDAP_SUCCESS) {
     fprintf(stderr, "ldap_simple_bind_s failed: %s\n",
     ldap_err2string(status));
     exit(1);
   }
   printf("simple bind works\n");
   exit(0);
 }

It doesn't works; It only works when I bind anonymous conenction or when I use cn=manager,dc=domain,dc=it as connection string (manager is my rootdn)

I migrated my /etc/passwd with the migration tools from padl.com, they import correctly all the fields in the directory.

This is the error given:

[root@pinguino druid]# ./a.out
ldap_simple_bind_s failed: Invalid credentials

Here are my config files and error logs:

slapd.conf

include         /usr/local/etc/openldap/schema/core.schema
include         /usr/local/etc/openldap/schema/cosine.schema
include         /usr/local/etc/openldap/schema/nis.schema
pidfile         /usr/local/var/slapd.pid
argsfile        /usr/local/var/slapd.args
modulepath     /usr/local/libexec/openldap
moduleload     back_ldap.la
moduleload     back_ldbm.la
moduleload     back_passwd.la
moduleload     back_shell.la
database        ldbm
suffix          "dc=domain,dc=it"
rootdn          "cn=manager,dc=domain,dc=it"
rootpw          secret
directory       /usr/local/var/openldap-ldbm
index   objectClass     eq

and here are logs from syslog:

Mar 1 12:21:39 pinguino slapd[15422]: daemon: conn=187 fd=57 connection from IP
=127.0.0.1:1832 (IP=0.0.0.0:34049) accepted.
Mar 1 12:21:39 pinguino slapd[16481]: conn=187 op=0 BIND dn="UID=DRUID,OU=PEOPL
E,DC=EVECTORS,DC=IT" method=128
Mar 1 12:21:39 pinguino slapd[16481]: conn=187 op=0 RESULT tag=97 err=49 text=


Do you have any clue? I'm really desperate :) (Maybe I need a good acl?)