Bug 454076 - can't edit user win non-ascii letters in name
can't edit user win non-ascii letters in name
Status: CLOSED ERRATA
Product: freeIPA
Classification: Community
Component: WebUI (Show other bugs)
unspecified
All Linux
low Severity high
: ---
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
:
Depends On:
Blocks: 453489
  Show dependency treegraph
 
Reported: 2008-07-04 09:05 EDT by Pavel Volkovitskiy
Modified: 2015-01-04 18:33 EST (History)
3 users (show)

See Also:
Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
trace (11.67 KB, text/plain)
2008-07-04 09:05 EDT, Pavel Volkovitskiy
no flags Details
trace of adding a group with non-ascii characters (2.83 KB, application/octet-stream)
2008-07-22 12:34 EDT, Rob Crittenden
no flags Details
patch to fix template encoding (7.91 KB, patch)
2008-07-22 15:30 EDT, Rob Crittenden
no flags Details | Diff

  None (edit)
Description Pavel Volkovitskiy 2008-07-04 09:05:20 EDT
i use 1.1.1 version

i added user with russian letters in name
now if i try to edit that user in web interface i have http 500 error and trace
in log
Comment 1 Pavel Volkovitskiy 2008-07-04 09:05:20 EDT
Created attachment 311039 [details]
trace
Comment 2 Rob Crittenden 2008-07-07 10:25:13 EDT
Jason, does this seem right?

I think we need to add kid.encoding="utf-8" to /usr/share/ipa/ipagui/config/app.cfg

The kid templates themselves already list utf-8 as the charset but I think the
above is needed for the controllers.
Comment 3 Jason Gerard DeRose 2008-07-07 16:16:30 EDT
Pavel,

If you don't mind, I could use a bit more information:

1) Did you add the user through the web UI? And was this user added using 1.1.1?
2) What browser and version are you using?
3) What is the user name you are trying to use?

I should have this figured out shortly.

Cheers,
Jason
Comment 4 Pavel Volkovitskiy 2008-07-08 11:57:59 EDT
sure

1. yes via 1.1.1 web ui

2. firefox 3 on linux (utf8 locale)

3. i tried to use "Павел Волковицкий"
Comment 5 Rob Crittenden 2008-07-22 11:22:50 EDT
This only affects the forms that we manually load using
widgets.meta.load_kid_template(). The code path manages to elude every single
place in the TurboGears kid support where the encoding would be set so it uses
the python default encoding (sys.getdefaultencoding()) which is 'ascii'.
Comment 6 Pavel Volkovitskiy 2008-07-22 12:09:52 EDT
i can make it work if i change 'ascii' to 'utf-8' in
/usr/lib/python2.5/site.py:def setencoding(): encoding = 'ascii'

but that's not proper fix
Comment 7 Rob Crittenden 2008-07-22 12:15:47 EDT
Right. I'm working on a patch that will load the forms templates with the proper
encoding (and it should honor kid.encoding in app.cfg)
Comment 8 Rob Crittenden 2008-07-22 12:34:25 EDT
Created attachment 312362 [details]
trace of adding a group with non-ascii characters

I an attempt to be thorough I tested adding a group with Павел in the
description and it failed in ldapobject.py. So a different but related problem.
Comment 9 Rob Crittenden 2008-07-22 13:09:56 EDT
Ok, the problem above wasn't that the description contained non-ascii values but
that the name of the group did.

There appears to be an issue handling items that are part of the DN that are not
ascii.
Comment 10 Rob Crittenden 2008-07-22 15:30:23 EDT
Created attachment 312388 [details]
patch to fix template encoding

We used to manually load the template files for the edit pages using
turbogears.meta.load_kid_template(). Unfortunately this went through the one
code path where encoding was completely ignored. It ended up defaulting to
sys.getdefaultencoding() which is 'ascii'. So even though most of the templates
are loaded as 'utf-8' the few that really mattered weren't.

The fix is to call kid.load_template() ourselves and set the encoding of the
class we just loaded to either the setting in the app.cfg file or to the normal
default value of 'utf-8'.
Comment 11 Rob Crittenden 2008-07-29 11:33:26 EDT
master: bae3a2101fc3cf79cc90bd0f807de226aeb46f5e
Comment 12 Jenny Galipeau 2008-11-25 08:33:57 EST
fix verified:

USER
[root@jennyv3 sysrestore]# ipa-adduser tester2
First name: Павел
Last name: Волковицкий
tester2 successfully added

[root@jennyv3 sysrestore]# ipa-finduser tester2
First Name: 0J/QsNCy0LXQuw==
Last Name: 0JLQvtC70LrQvtCy0LjRhtC60LjQuQ==
Home Directory: /home/tester2
Login Shell: /bin/bash
Login: tester2

GROUP
[root@jennyv3 sysrestore]# ipa-addgroup mygroup
Description: Павел
mygroup successfully added

Note You need to log in before you can comment on or make changes to this bug.