Perdition-ldap

Yesterday I worked with perdition. My mission was to let it get its information from an existing ldap tree.

There is not much documentation about the ldap configuration of perdition. ok it’s not much to configure, but if it doesn’t work it’s hard to find the problem.
There is this pdf document and this man page (scroll down till the LDAP part).

I included the perdition schema in my openldap configuration but I wasn’t able to add the perdition objectClass to my already configured objectClasses. It seems that the perditionPopmap objectClass is STRUCTURAL just like inetOrgPerson objectClass, and it is not possible to have 2 STRUCTURAL objectClasses. The solution is to change the perdition.schema and put AUXILIARY in stead of STRUCTURAL.

I got it all configured but I didn’t see any connection with my ldap. I put on the debugging and saw this message appearing in my log file.

dbserver_get: ldap_initialize: No such file or directory

If found in this mailinglist post that it is a bug, and it will be fixed in the next release, but it isn’t!
So let’s fix it ourself.

I downloaded the .src.rpm and installed it. Unpacked the perdition archive in the SOURCES directory, edited perdition/db/ldap/perditiondb_ldap.c and repacked the archive. Finally I’ve build the rpms from the .spec file.
This is the important part in the changed file, only the #IF line has changed.

        /* Open LDAP connection */
#if 0
// #if defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000)
        if (ldap_initialize(&connection, pldap_filter) != LDAP_SUCCESS) {
                VANESSA_LOGGER_DEBUG_ERRNO("ldap_initialize");
                goto leave;
        }
#else
        connection = ldap_init(lud->lud_host, lud->lud_port);
        if (!connection) {
                VANESSA_LOGGER_DEBUG_ERRNO("ldap_init");
                goto leave;
        }
#endif

When the new rpm’s are installed it just worked!

This is how my ldap-specific configuration looks like in the perdition.conf

M /usr/lib/libperditiondb_ldap.so
m "ldap://localhost/dc=x-tend,dc=be?uid,mailhost?sub?(uid=%s)?!BINDNAME=cn=Manager%2cdc=x-tend%2cdc=be,X-BINDPW=xxXXxx"

One Comment

  1. Taner Ozdas said:

    Did you have a change to use perdition-ldap with ldaps://host/ urls.

    I have found below discuss:

    http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg508068.html

    But i couldn’t where to start to recompile perdition ?

    My Linux ver : debian lenny

Leave a Reply