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

Question on aliases [was: Re: Tree structure]



Hi,

a while ago on here, the posting I've included below appeared. The
functionality it outlines seems useful but I have been seeing some
strange results when trying such things out, so I wonder if someone
could clarify what is happening for me.

I have the following objects in a test tree, access to * by * read

o=Organisation,c=XX
ou=Real OU,o=Organisation,c=XX
ou=Fake OU,o=Organisation,c=XX
ou=Real OU,ou=Fake OU,o=Organisation,c=XX

The latter being an alias, as shown in the original posting to

ou=Real OU,o=Organisation,c=XX

(the idea being to impose another organisational structure on top of
 the underlying "real" one)

However, when I come to do a search with 

 -s one -a always -b 'ou=Fake OU,o=Organisation,c=XX' '(ou=*)'

I was expecting to get the "Real OU" via the alias. I got nothing.


When I did the search thus

-s sub -a always -b 'ou=Fake OU,o=Organisation,c=XX' '(ou=*)'

I got the following results:

dn: ou=Fake OU,o=Organisation,c=XX
dn: ou=Real OU,o=Organisation,c=XX

ie I get the aliased ou plus the root of the serach object.

My questions thus are:

1) Can I initiate a search below "Fake OU" such that I only get the
    "Real OU" 
   (rather all objects one level below the root of the search in the Fake tree)

2) Have I missed something (everything ?) in my understanding of the
    alias mechanism that solves, or maybe even negates the other question.

Thanks for any pointers,
Kevin

> 
> On Mon, 2002-10-14 at 16:55, Hallvard B Furuseth wrote:
> > Yonah Russ writes:
> > >   I'm wondering if there is any built-in/recommended method for
> > > cross-referencing entries in the tree... for example, I would like to
> > > have in the organization tree a ou (ie. campus name) with all the
> > > members of that ou AND I would also like to have another ou (ie.
> > > Department name) with the same entries but organized according to some
> > > other shared attribute.
> > 
> > You could use aliases.  First create e.g.
> 
> Thank you! This is perfect!
> 
> >    cn=Yonah Russ, ou=Campus, dc=jct, dc=ac, dc=il
> > 
> > as a normal entry.  Then create:
> > 
> >    dn: cn=Yonah Russ, ou=Department Name, dc=jct, dc=ac, dc=il
> >    objectclass: alias
> >    aliasedObjectName: cn=Yonah Russ, ou=Campus, dc=jct, dc=ac, dc=il
> > 
> > and use the option for derefAliases=derefAlways in the LDAP search
> > operations.  E.g. with ldapsearch you specify '-a always'.
> > 
> > -- 
> > Hallvard


-- 
Regards,

----------------------------------------------------------------------
*  Kevin M. Buckley              e-mail: K.Buckley@lancaster.ac.uk   *
*                                                                    *
*  Systems Administrator                                             *
*  Computer Centre                                                   *
*  Lancaster University          Voice:  +44 (0) 1524 5 93718        *
*  LANCASTER. LA1 4YW            Fax  :  +44 (0) 1524 5 25113        *
*  England.                                                          *
*                                                                    *
*  My PC runs Linux/GNU, you still computing the Bill Gate$' way ?   *
----------------------------------------------------------------------