Module: check_mk
Branch: master
Commit: 8fdd78a2206a985a44d74d47157c3caba0502a28
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8fdd78a2206a98…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 12 14:03:21 2013 +0100
FIX LDAP: Fixed problem syncing contactgroups of a user with umlauts in CN
---
.werks/210 | 8 ++++++++
ChangeLog | 1 +
web/plugins/userdb/ldap.py | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.werks/210 b/.werks/210
new file mode 100644
index 0000000..a535af8
--- /dev/null
+++ b/.werks/210
@@ -0,0 +1,8 @@
+Title: LDAP: Fixed problem syncing contactgroups of a user with umlauts in CN
+Level: 1
+Component: multisite
+Version: 1.2.3i7
+Date: 1384261370
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 6344b76..2b823af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* 0203 FIX: Changed sidebar reload interval to be more random...
* 0204 FIX: Reduced I/O on logins with access time recording or failed login
counts...
* 0206 FIX: Fixed logwatch permission check when using liveproxy...
+ * 0210 FIX: LDAP: Fixed problem syncing contactgroups of a user with umlauts in CN
WATO:
* 0053 New rule for configuring the display_name of a service...
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 92f4fd5..a73ca1d 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -532,7 +532,7 @@ def ldap_group_members(filters, filt_attr = 'cn', nested =
False):
for dn, obj in
ldap_search(ldap_replace_macros(config.ldap_groupspec['dn']), filt, ['cn',
member_attr]):
groups[dn] = {
'cn' : obj['cn'][0],
- 'members' : obj.get(member_attr, []),
+ 'members' : [ m.encode('utf-8') for m in obj[member_attr]
],
}
else:
# Nested querying is more complicated. We have no option to simply do a query for
group objects
@@ -560,7 +560,7 @@ def ldap_group_members(filters, filt_attr = 'cn', nested =
False):
'cn' : cn,
}
for user_dn, obj in
ldap_search(ldap_replace_macros(config.ldap_userspec['dn']), filt, columns =
['dn']):
- groups[dn]['members'].append(user_dn)
+ groups[dn]['members'].append(user_dn.encode('utf-8'))
g_ldap_group_cache[cache_key] = groups
return groups