reqa / ldap-lmdb-dntree

Implementation of a hierarchical adjecency list to store LDAP DNs in an lmdb database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synopsis

dntree is an example implementation that shows how LDAP DNs can be stored in an lmdb database, structured as a hierarchical adjecency list.

Code Example

An example showing how dntree can be used is given in dntree-example1.c.

Motivation

I was curious to learn how to use lmdb. At univention we use the back-mdb backend, which is very reliable and performant. So lmdb seems like a good choice for LDAP DN related stuff. But lmdb limits key size to 511 bytes by default. So, to use lmdb in some contexts dealing with LDAP DNs (or file paths for that matter) it is useful to map DN values to ID keys and vice versa.

API Reference

The API, as defined by dntree.h is bound to change as this experiment continues.

Tests

make
./dntree-example1 -d 3

libldap and liblmdb need to be installed for this.

Contributors

Currently this code is maintained by the author, feedback is welcome.

License

Copyright 2016-2017 Univention GmbH
Copyright 2016-2017 Arvid Requate

The source code of this program is made available under the terms of the OpenLDAP Public License.

This code is derived from dn2id.c written by Howard Chu. The code of dn2id.c has been published under OpenLDAP Public License.
A copy of that license is available online.

About

Implementation of a hierarchical adjecency list to store LDAP DNs in an lmdb database


Languages

Language:C 93.6%Language:Makefile 6.4%