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

Re: getting at the schema for an object



søn, 2002-12-29 kl. 12:39 skrev Ben Martin:

> After looking at the sources for gq and the list archives I am still a
> little lost as to how given a DN to get the schema for that object.

I'm a little puzzled about what you mean, even after having read the
rest a couple of times.

Supposing I want to get all the object classes for
dn="cn=tonye,ou=people,ou=groups,dc=billy,dc=demon,dc=nl" and from these
deduce the schemas (because there are a number of relevant schemas
involved):

ldapsearch -x -H ldaps://localhost/ '(&(uid=tonye)(objectClass=*))' |
grep objectClass

1027 [root:billy.demon.nl] /root # ldapsearch -x -H ldaps://localhost/
'(&(uid=tonye)(objectClass=*))
# filter: (&(uid=tonye)(objectClass=*))
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: evolutionPerson
objectClass: posixAccount
objectClass: shadowAccount
objectClass: calEntry

The above is only for an anonymous bind, but should be sufficient, since
unless anonymous binds are prohibited (2.1.9 and above), you get to see
all objectclasses, irrespective of ACLs.

grep each objectclass in the schema directory will surely return the
relevant schemas? Apart from those "built in" [1]

> I'm using the C API to do this.

Possibly. I'm using the command line. In as much as I can (in theory, I
don't in practice, apart from cal.schema and bits of
evolutionPerson.schema) define my own schemas, what other way would
there be? I've stuffed all sorts of Horde basic stuff into
evolutionPerson.schema, so what does/do the schema(s) have to do with
objectClasses? let alone other attributes?

*[1] Granted GQ doesn't let one see what schemas give rise to what
attributes. But, then some attributes are "built in" to 2.1.8 slapd and
3 other 2.1.8 Openldap utils, irrespective of schemas.

Best,

Tony

Puzzled

-- 

Tony Earnshaw

When all's said and done ...
there's nothing left to say or do.

e-post:		tonni@billy.demon.nl
www:		http://www.billy.demon.nl