- Bug: LDAPMultiPlugin.enumerateUsers: The variable used as key for the

caching mechanism was mutated after being computed, leading to cache
  keys that can never be found again. Found by Wichert Akkerman.
  (http://www.dataflake.org/tracker/issue_00613)


git-svn-id: http://svn.dataflake.org/svn/Products.LDAPMultiPlugins/trunk@1573 835909ba-7c00-0410-bfa4-884f43845301
This commit is contained in:
jens 2008-07-18 16:53:07 +00:00
parent 89f4fd8f5d
commit a078614520
2 changed files with 12 additions and 7 deletions

View File

@ -6,6 +6,11 @@ To see earlier changes please see HISTORY.txt.
1.7 (unreleased)
----------------
- Bug: LDAPMultiPlugin.enumerateUsers: The variable used as key for the
caching mechanism was mutated after being computed, leading to cache
keys that can never be found again. Found by Wichert Akkerman.
(http://www.dataflake.org/tracker/issue_00613)
1.6 (2008-06-05)
----------------

View File

@ -197,7 +197,7 @@ class LDAPMultiPlugin(LDAPPluginBase):
else:
l_results = []
seen = []
criteria = {}
ldap_criteria = {}
if id:
if uid_attr == 'dn':
@ -205,23 +205,23 @@ class LDAPMultiPlugin(LDAPPluginBase):
# is searched for I need to hack around it... This
# limits the usefulness of searching by ID if the user
# folder uses the full DN aas user ID.
criteria[rdn_attr] = id
ldap_criteria[rdn_attr] = id
else:
criteria[uid_attr] = id
ldap_criteria[uid_attr] = id
if login:
criteria[login_attr] = login
ldap_criteria[login_attr] = login
for key, val in kw.items():
if key not in (login_attr, uid_attr):
criteria[key] = val
ldap_criteria[key] = val
# If no criteria are given create a criteria set that will
# return all users
if not login and not id:
criteria[login_attr] = ''
ldap_criteria[login_attr] = ''
l_results = acl.searchUsers(**criteria)
l_results = acl.searchUsers(**ldap_criteria)
for l_res in l_results: