dataflake.org

Home Documentation Software Old Stuff

Bug in keyword handling for search caching (Resolved)

Request LDAPMultiPlugins -- bug report -- by Wichert Akkerman
Posted on Jul 18, 2008 10:13 am
Subscribe

Enter your email address to receive mail on every change to this issue.

Entries (Latest first)


  Resolve by Jens Vagelpohl on Jul 18, 2008 12:54 pm
  Thanks, good catch! Checked in:

http://svn.dataflake.org/viewvc?view=rev&revision=1573

 

  Initial Request by Wichert Akkerman on Jul 18, 2008 10:13 am
  enumerateUsers modifies reuses the criteria variable. As a result of that the ZCachable_set uses the wrong keywords which leads to cache entries that can never be retrieved. The patch below fixes this.

--- LDAPMultiPlugin.py 2008-07-18 16:10:48.000000000 +0200
+++ /tmp/LDAPMultiPlugin.py 2008-07-18 16:09:46.000000000 +0200
@@ -197,7 +197,7 @@
else:
l_results = []
seen = []
- criteria = {}
+ ldap_criteria = {}

if id:
if uid_attr == 'dn':
@@ -205,23 +205,23 @@
# 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: