Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 454076

Summary: can't edit user win non-ascii letters in name
Product: [Retired] freeIPA Reporter: Pavel Volkovitskiy <olfway>
Component: WebUIAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: high Docs Contact:
Priority: low    
Version: unspecifiedCC: benl, dpal, jgalipea
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
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: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 453489    
Description Flags
trace of adding a group with non-ascii characters
patch to fix template encoding none

Description Pavel Volkovitskiy 2008-07-04 13:05:20 UTC
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 13:05:20 UTC
Created attachment 311039 [details]

Comment 2 Rob Crittenden 2008-07-07 14:25:13 UTC
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 20:16:30 UTC

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.


Comment 4 Pavel Volkovitskiy 2008-07-08 15:57:59 UTC

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 15:22:50 UTC
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 16:09:52 UTC
i can make it work if i change 'ascii' to 'utf-8' in
/usr/lib/python2.5/ setencoding(): encoding = 'ascii'

but that's not proper fix

Comment 7 Rob Crittenden 2008-07-22 16:15:47 UTC
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 16:34:25 UTC
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 So a different but related problem.

Comment 9 Rob Crittenden 2008-07-22 17:09:56 UTC
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

Comment 10 Rob Crittenden 2008-07-22 19:30:23 UTC
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 15:33:26 UTC
master: bae3a2101fc3cf79cc90bd0f807de226aeb46f5e

Comment 12 Jenny Galipeau 2008-11-25 13:33:57 UTC
fix verified:

[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

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