SEC-992: SpringSecurityLdapTemplate: clearing the returningObjFlag of SearchControls contradicts contract with LdapTemplate #1242

spring-issuemaster opened this Issue Sep 29, 2008 · 1 comment

1 participant


Jürgen Failenschmid (Migrated from SEC-992) said:

In method searchForSingleAttributeValues(String, String, Object[], String) of class SpringSecurityLdapTemplate, on line 168, there is this call:


Then the search(String, String, Object[], String) method is called with a context mapper, which implies that returnObj must be true in SearchControls. LdapTemplate checks the returningObjFlag state, and if it is false, sets it to true. It also emits an INFO log entry about the inconsistency.

The documentation of class SearchControls states for the controls argument:

“The SearchControls to use in the search. If the

  • returnObjFlag is not set in the SearchControls,
  • this method will set it automatically, as this is required for
  • the ContextMapper to work.

Setting the returningObjFlag to false is at best superfluous, at worst some behavior of the search is desired, which cannot be achieved this way.


Luke Taylor said:

Thanks. I’ve made the change as suggested (removing the setReturnObjFlag(false)). Not sure why it was there to start with.

@spring-issuemaster spring-issuemaster added this to the 3.0.0 M1 milestone Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment