LDAP users with non-ASCII characters in their name cause login page to crash when user lookup method is 'search' (MS AD)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
High
|
Morten Brekkevold | ||
3.15 |
Fix Released
|
High
|
Morten Brekkevold | ||
4.0 |
Fix Released
|
High
|
Morten Brekkevold |
Bug Description
Traceback from Ålesund University College:
[Tue Apr 01 11:29:17 2014] [ERROR] [pid=18668 django.request] Internal Server Error: /index/login/
Traceback (most recent call last):
File "/usr/lib/
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/
return view(request, *args, **kwargs)
File "/usr/lib/
return do_login(request)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
account = auth.authentica
File "/usr/lib/
auth = ldapauth.
File "/usr/lib/
user.
File "/usr/lib/
self.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 18: ordinal not in range(128)
Analysis:
The code does not consider that the user search result from the
LDAP server is already encoded as UTF-8. Attempting to encode an already
encoded string will cause Python to attempt to decode it from ASCII to
unicode, before encoding that as UTF-8 again.
Changed in nav: | |
status: | Confirmed → In Progress |
Changed in nav: | |
status: | Fix Committed → Fix Released |
fix here: https:/ /nav.uninett. no/hg/stable/ rev/23d77415409 4