I started adding code to inject the "ref" attribute into the returningAttributes
property of the SearchControls to enable the detection of a referral. As I was doing
this I had to make the attribute selection code add all attributes when just [ref] was
found in the returningAttributes field since ref is synthetically injected. Sometimes
though users will just want to have only the [ref] attribute returned and will specify
that in the returningAttributes list. There is then no way for to differentiate between
these situations when the user intentionally only requests the ref attribute verses
when the server artificially injects it.
So instead I altered the core code responsible for selecting attributes to always
return the ref attribute regardless of whether it is specified in the returningAttributes
list or not. This way if the user just specifies the [ref] attribute only that attribute
will be returned instead of returning it and all the non-operational attributes.
Now we only need to add some code that makes sure the ref attribute is removed
from the entry if the ManageDsaIT
control is enabled and the user did not explicitly
ask for the ref attribute. This however is a very rare situation. Why would this
control be enabled by a client without the intention of getting the ref attribute
when a referral only has a ref attribute in it? I cannot think of a good use case
for this. So I'm not going to bother adding code to remove the ref attribute at this
point in time. Let me know if you think we still should and I can add it.