Error creating user with unicode username

Bug #1166701 reported by Liang Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
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)
Changed in keystone:
assignee: nobody → Liang Chen (cbjchen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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)
Changed in keystone:
milestone: none → havana-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → High
Thierry Carrez (ttx)
Changed in keystone:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.