You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Joe Lewis <jo...@joe-lewis.com> on 2006/10/19 22:04:05 UTC
Using util_ldap to retrieve attributes on a DC
I've been reviewing the archives looking for information on using
util_ldap to retrieve attributes from an object out of an LDAP
connection. However, I haven't really seen any postings on it in there,
and thought I'd try and propose the question to the list.
First, a little background. I have a functional module for pushing
pages through a template mechanism, parsing in menu's, etc. I wrote it
about three or four years ago. Last spring, I added in a component to
retrieve the location of where the template file is located with respect
to the ServerName from a domain context in an LDAP source. That works.
Here's the question, though. Is there any way to use util_ldap to
retrieve the attribute instead of relying completely on my own ldap
functions? I've looked through the util_ldap.c code, and don't really
see any functions that would allow the retrieval of attributes from an
object (non-user) in LDAP. Plenty of util_ldap_getuserdn and
util_ldap_checkuserid, but nothing for util_ldap_getdn or anything
similar. Is this even possible, or, should I implement all of the #if
declarations for the proper SDK?
Joe
Re: Using util_ldap to retrieve attributes on a DC
Posted by Joe Lewis <jo...@joe-lewis.com>.
Thanks for the response, Eric!
Eric Covener wrote:
> On 10/19/06, Joe Lewis <jo...@joe-lewis.com> wrote:
>> I've looked through the util_ldap.c code, and don't really
>> see any functions that would allow the retrieval of attributes from an
>> object (non-user) in LDAP.
> Looks to me like the cache provided by util_ldap is very
> compare-centric, so you'd have a fair amount of work teaching it to
> manage/return values returned by searches via some new interface and
> an extension of the cache.
I was just hoping there were some methods that I didn't see in the
default util_ldap.c file. Obviously, my eyes did not deceive me.
> I would think that the sequence of
> ldap_search/ldap_get_values/ldap_msgfree would be SDK agnostic (more
> so then the SSL freakshow that apr ldap provides a wrapper for). You
> can see in util_ldap.c that the actual core LDAP calls aren't wrapped
> by any abstraction.
I suspected that this was true. It's easy enough to leave well enough
alone. (Plus, I could almost guarantee that the resulting code will be
shorter - and shorter = cleaner = simpler = more efficient code, unless
you are working with Perl obfuscation.) I'll just leave well enough
alone (unless someone else recognizes a major need).
Joe
Re: Using util_ldap to retrieve attributes on a DC
Posted by Eric Covener <co...@gmail.com>.
On 10/19/06, Joe Lewis <jo...@joe-lewis.com> wrote:
> I've looked through the util_ldap.c code, and don't really
> see any functions that would allow the retrieval of attributes from an
> object (non-user) in LDAP. Plenty of util_ldap_getuserdn and
> util_ldap_checkuserid, but nothing for util_ldap_getdn or anything
> similar.
Looks to me like the cache provided by util_ldap is very
compare-centric, so you'd have a fair amount of work teaching it to
manage/return values returned by searches via some new interface and
an extension of the cache.
> Is this even possible, or, should I implement all of the #if
> declarations for the proper SDK?
I would think that the sequence of
ldap_search/ldap_get_values/ldap_msgfree would be SDK agnostic (more
so then the SSL freakshow that apr ldap provides a wrapper for). You
can see in util_ldap.c that the actual core LDAP calls aren't wrapped
by any abstraction.
--
Eric Covener
covener@gmail.com