directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Alias handling issues
Date Wed, 15 Jun 2011 15:19:24 GMT

sadly, things are not as rosy as I exepected...

I have written a few tests to check if we correctly detect cycles while 
processing a search, and at some point, I found that cycle are not an 
issue at all. But wait, it's not a good news :/

Let's say you have the following entries :

     cn=barAlias,cn=foo,cn=test -> cn=bar,cn=test
     cn=dohAlias,cn=foo,cn=test -> cn=doh,cn=test

Logically, doing a SUBTREE search on cn=foo,cn=test, you should get the 
following entries :

This is *not* what we get. Currently, you'll have :

The second alias dereferencing is never done.

Obviously, it helps when it come sto avoid cycle, but this is certainly 
not the expected behavior.

Now, if we want to do alias chasing on the server, we will have to 
modify the way we handle alias : each one of them will issue a new 
search, wth a new cursor.

Hopefully, stacking the aliases to be processed works well with the fact 
that we have to stack the aliases for cycle detection. One possible 
solution would be to process this stack alias after alias, and if we get 
back an alias, we add it in the stack if it's not already present 
(otherwise, that means we have a cycle).

In our sample, we will have the following stack :
() : empty stack
(cn=barAlias,cn=foo,cn=test) : first alias met
-> here, we have processed all the entries for the initial search
   [cn=bar,cn=test] (the dereferenced alias)
-> now, we get the leftmost element in the stack, and launch a new search
(<cn=barAlias,cn=foo,cn=test>) : this alias is being processed, thus the <>
(<cn=barAlias,cn=foo,cn=test>, cn=dohAlias,cn=foo,cn=test) : second 
alias met
-> again, all the entries have been processed, we take the next alias in 
the stack
(<cn=barAlias,cn=foo,cn=test>, <cn=dohAlias,cn=foo,cn=test>) : second 
alias met
-> there are no further entries. We are done

Seems to work... Did I miss something ?

Emmanuel L├ęcharny

View raw message