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

Re: Unix sockets connection to server ?



>To add support for UNIX protocol family sockets may require you
>extend the LDAP information model in some areas.  In particular,
>you may need to define an URL format for LDAP over UNIX IPC.

I decided to implement this, largely for fun, but also as I've
been thinking about tying in a KDC to an LDAP datastore and
would prefer for the two to communicate via IPC rather than
making the KDC a thread in the LDAP server. 

You can specify slapd listeners with the ldapi: URL scheme (eg.
slapd -h ldapi:///) which by default opens /tmp/.ldap-sock.

The client side was a bit trickier and I need to figure out 
the correct way to integrate this with the existing API. I
copied os-ip.c to os-local.c, modified it as appropriate,
and fixed up ldap_new_connection() to make the right sort
of connection based on a flag in the LDAPServer struct, but
how the end-user gets to this I'll need to think about.

To test, I did the following kludge:

    ld = ldap_init("/tmp/.ldap-sock", LDAP_PORT);
    if (ld == NULL) {
        perror("ldap_init");
        return 1;
    }
        /* now switch over the conn */
    ldap_open_local_defconn(ld); /* like ldap_open_defconn() */

I'll release the code after I've tidied it up a bit.


-- Luke

--
Luke Howard
PADL Software Pty Ltd
http://www.padl.com/