Peter Galbavy <Peter.Galbavy@knowledge.com> writes:
> And then what about LDAP ? (Note: I know very little personally about
> LDAP, with no direct experience except as an occasional public directory
> user). People keep mentioning it though. It can be thought of as a DB
LDAP can most usefully be thought of as a network-accessible hash table,
with a little twist. Each entry has a bunch of key/value pairs, and the
standard search is for a given value in a given key. LDAP then returns
all key/value pairs in each "entry" that contains the key/value pair you
For example, if I do:
I get all key/value pairs in every entry that contains the key/value pair
"userid=rra". I can limit this further if I just want one particular bit
of information, like surname:
windlord:~> ldapsearch userid=rra sn
cn=Richard Russell Allbery, ou=People, o=Stanford University, c=US
The first line is the identifier of the whole entry (this particular LDAP
server is still using the old organizational scheme; this has been changed
in our newer server) and the second is the particular attribute (sn,
surname) that I was asking for.
The problem with doing anything with LDAP is that the names of the keys
vary from one site to another. I believe there's some rudimentary
standardization underway, but it's not gotten very far. In the meantime,
you have to know the schema that a site is using in order to get anything
useful out of it.
There is a Perl module that lets you do LDAP queries, so you don't have to
use the command line client, at least in theory. For Majordomo work, I
think what you'd have to do is, for each piece of information you wanted
to get out of LDAP, specify how to search (what key and what value) and
what key contains the value you're looking for.
There are more complicated searches than simple matches allowed, by the
way. There's wildcard support and some fuzzy matching support and other
stuff. This is all a simplification of something that I personally find
horribly complicated and very difficult to understand.
Russ Allbery (email@example.com) <URL:http://www.eyrie.org/~eagle/>