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

DN manipulation

Before i start please forgive me if this is not the proper list to post
these kinds of questions to.

I am writing a very basic ldap server based off of openldap's
wonderful libraries. Our organization has a rather unique/custom
platform that would make it very difficult to run the stock slapd, without
spending month's hacking it to bits, mostly due to our proprietary
data store.

I have found the lber and ldap libs quite useful in my task. There is little
documentation for writing server side applications using the before
mentioned libs so I have had to become quite intimate with the openldap
source to move forward.

I have made quiet a bit of progress in that I have a functioning server
that seems to run quite nicely and queue up operations using the
ber_get_next/flush/scanf/printf/etc... And now I am at a point where
i need to start authenticating users etc.

So i have these lovely berval struct's that contains my DN.

uid=jluedke, dc=some, dc=concentric, dc=com

Now, my question is, what magic functions exist deep in the ldap
libs that will help me access this data. I am looking for something

struct berval dn // contains my DN above
char *uid = ldap_atrrib_get(dn, "uid");


while(p = ldap_attrib_get_all(dn, "dc"))
   strcat(domain, p);

Surely these kind of functions already exist in OpenLDAP someplace...
With so much code to scan over I am hoping an openLDAP guru can
point me in the right direction.