inetOrgPerson with member or memberOf?

user1907906 picture user1907906 · Dec 5, 2013 · Viewed 16.1k times · Source

What works

Suppose I have inetOrgPersons in ou=people,dc=example,dc=com. Example:

dn: cn=John Doe,ou=people,dc=example,dc=com
objectClass: inetOrgPerson (structural)
objectClass: person (structural)
objectClass: top (abstract)
cn: John Doe
sn: Doe
givenName: John
mail: [email protected]
uid: john.doe

In addition I have several organizations:

dn: o=foo,dc=example,dc=com
objectClass: organization (structural)
objectClass:top (abstract)
o: foo

dn: o=bar,dc=example,dc=com
objectClass: organization (structural)
objectClass:top (abstract)
o: bar

For each organization there is a groupOfNames:

dn: cn=users,o=foo,dc=example,dc=com
objectClass:groupOfNames (structural)
cn: users
member: cn=John Doe,ou=people,dc=example,dc=com

dn: cn=users,o=bar,dc=example,dc=com
objectClass:groupOfNames (structural)
cn: users

As you can see, cn=John Doe,ou=people,dc=example,dc=com is listed as a member of cn=users,o=foo,dc=example,dc=com but not of dn: cn=users,o=bar,dc=example,dc=com.

Problem

I want to note membership at the inetOrgPersons, too.

memberOf is not in the schemas I currently use for a user. Is there any schema available that provides memberOf?

member is part of groupOfNames but this objectClass conflicts with inetOrgPerson:

[LDAP: error code 65 - invalid structural object class chain (inetOrgPerson/groupOfNames)]

Question

How can I note the membership in cn=users,o=foo,dc=example,dc=com on cn=John Doe,ou=people,dc=example,dc=com?

Answer

user207421 picture user207421 · Dec 5, 2013

If you're using OpenLDAP you need to use the 'memberof' overlay, which maintains a real 'memberOf' attribute among the operational attributes.

Note that it won't affect memberships that already exist, only new ones from when you first load the overlay. See the OpenLDAP documentation.