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

displaying a tree of DNs by the most specific ou



This should be really simple but I'm completely stuck (and I couldn't
find this addressed in the list archives), so any help would be greatly
appreciated...

I have a structure like this:

ou=People
  dn=uid=foo,ou=People,dc=exoffice,dc=com
  ou=Engineering
    dn=uid=bar,ou=People,dc=exoffice,dc=com
    dn=uid=baz,ou=People,dc=exoffice,dc=com

(Note: although I'm only putting the ou=People attribute in the DN, the
bar and baz users do indeed have ou=Engineering as well as ou=People
attributes.)

I want to build a tree viewer which displays the entries under the most
specific ou *only*.  So although the foo, bar and baz users are all
People (and will all have ou=People as an attribute), I want the bar and
baz users who are in Engineering (and thus also have ou=Engineering as
an attribute) to only get displayed under the ou=Engineering node (and
not under the ou=People node).  Now, I know that I could maintain some
data structure on the client to ensure that entries which are displayed
in a more specific ou are not displayed in a more general ou, but for
performance/scalability reasons this is obviously completely
unacceptable.  Does anyone know how to do this in a search filter?  What
I want to say is something like "all entries where ou=x and ou=y and
nothing else!".

Thanks in advance,
Peter Armstrong