Error creating user with unicode username

Bug #1166701 reported by Liang Chen on 2013-04-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
High
Liang Chen

Bug Description

Creating user with unicode username will produce 500.

Here is the culprit in keystone/common/sql/core.py,

     73 if isinstance(column.type, String):
     74 if column.type.length and \
     75 column.type.length < len(str(v)):

It tries to construct a byte string object when testing the length of the string field (username in this case).
This will cause error if the string field ( v ) is a unicode object.

Liang Chen (cbjchen) on 2013-04-09
Changed in keystone:
assignee: nobody → Liang Chen (cbjchen)

Fix proposed to branch: master
Review: https://review.openstack.org/26465

Changed in keystone:
status: New → In Progress

Reviewed: https://review.openstack.org/26465
Committed: http://github.com/openstack/keystone/commit/78dcfc6446d2a367565f2fa58bb0da340c6928f8
Submitter: Jenkins
Branch: master

commit 78dcfc6446d2a367565f2fa58bb0da340c6928f8
Author: Liang Chen <email address hidden>
Date: Tue Apr 9 18:03:48 2013 +0800

    Fixed unicode username user creation error

    The code tries to construct a byte string object to test the
    length of the string field (The explicit construction of the
    string object is neccessary as sometime v can be other types,
    for example int). This will cause error if the string field
    (v) is a unicode object.

    Fixes bug #1166701

    Change-Id: I73cee4da5c9f91ce135e7f81d88c979871f61767

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-05-29
Changed in keystone:
milestone: none → havana-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph) on 2013-08-28
Changed in keystone:
importance: Undecided → High
Thierry Carrez (ttx) on 2013-10-17
Changed in keystone:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers