Bug 150864 - User Management module can't be loaded in System Settings when "comment" field of an account includes an accentuated character
Summary: User Management module can't be loaded in System Settings when "comment" fiel...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: guidance
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-15 17:35 UTC by Jean-Paul Iribarren
Modified: 2018-09-02 22:18 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Paul Iribarren 2007-10-15 17:35:50 UTC
Version:           0.2 (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
OS:                Linux

I work in the french subsidiary of an international company, and I am setting up a Kubuntu server machine (english language / french keyboard selected). I have used command-line utilities for creating user accounts for a couple colleagues, including the usual info: full name, login, temporary password... One such full name -- which goes to the "comment" field of /etc/passwd -- included an accentuated letter "é" (code 0xc3). Once it has been created, I haven't been able to use the User Management module anymore on this machine. System Settings kept on reporting that "user management could not be loaded". After a bit of Googling, I could find that I could run this specific module from a console by using "kcmshell System/userconfig". Below is the result of this test:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jpiribar@samba3:~$ kcmshell System/userconfig

Pythonize constructor -- pid = 10856
Python interpreter initialized!



Pythonize constructor -- pid = 10856
Traceback (most recent call last):
  File "<string>", line 8, in kcontrol_bridge_create_userconfig
  File "/var/lib/python-support/python2.5/userconfig.py", line 1696, in create_userconfig
    return UserConfigApp(parent, name)
  File "/var/lib/python-support/python2.5/userconfig.py", line 267, in __init__
    self.admincontext = unixauthdb.getContext(isroot)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 74, in getContext
    return PwdContext(editmode)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 727, in __init__
    for line in fhandle.readlines():
  File "/usr/lib/python2.5/codecs.py", line 626, in readlines
    return self.reader.readlines(sizehint)
  File "/usr/lib/python2.5/codecs.py", line 535, in readlines
    data = self.read()
  File "/usr/lib/python2.5/codecs.py", line 424, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1425: ordinal not in range(128)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/apport_python_hook.py", line 44, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwdu(), sys.argv[0]))
AttributeError: 'module' object has no attribute 'argv'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 8, in kcontrol_bridge_create_userconfig
  File "/var/lib/python-support/python2.5/userconfig.py", line 1696, in create_userconfig
    return UserConfigApp(parent, name)
  File "/var/lib/python-support/python2.5/userconfig.py", line 267, in __init__
    self.admincontext = unixauthdb.getContext(isroot)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 74, in getContext
    return PwdContext(editmode)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 727, in __init__
    for line in fhandle.readlines():
  File "/usr/lib/python2.5/codecs.py", line 626, in readlines
    return self.reader.readlines(sizehint)
  File "/usr/lib/python2.5/codecs.py", line 535, in readlines
    data = self.read()
  File "/usr/lib/python2.5/codecs.py", line 424, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1425: ordinal not in range(128)
error: *** runFunction failure
;
jpiribar@samba3:~$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When I examined the Python code, I could see that it was opening file /etc/passwd, and I could confirm (with hexdump) that the offending character (at offset 1425) was actually the accentuated "é" used in my colleague's full name. Next, I have used "sudo usermod -c <full name> <account>" to replace the "é" character with a non-accentuated "e", and the User Manager module is happy and running again.

No big deal, but it takes some time to figure, especially considering that when it runs under a french environment, User Manager accepts accentuated letters in full names.
Comment 1 Peter Colman 2008-11-08 15:07:43 UTC
This module also fails if you have enabled the NIS Client (ypbind). A new entry is placed at the end of /etc/passwd, without which the bind fails. 

extra line in /etc/passwd
+::::::

This causes a failure in the userconfig module (listing follows)
=======================================
Pythonize constructor -- pid = 389
Traceback (most recent call last):
  File "<string>", line 8, in kcontrol_bridge_create_userconfig
  File "/var/lib/python-support/python2.5/userconfig.py", line 1735, in create_userconfig
    return UserConfigApp(parent, name)
  File "/var/lib/python-support/python2.5/userconfig.py", line 267, in __init__
    self.admincontext = unixauthdb.getContext(isroot)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 74, in getContext
    return PwdContext(editmode)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 730, in __init__
    newuserobj._initString(line)
  File "/var/lib/python-support/python2.5/unixauthdb.py", line 1018, in _initString
    self._uid = int(self._uid)
ValueError: invalid literal for int() with base 10: ''
error: *** runFunction failure
=======================================
Comment 2 FiNeX 2008-11-14 00:22:38 UTC
This module was developed by kubuntu. Please report it on uubuntu launchpad.
Comment 3 FiNeX 2008-11-14 01:06:33 UTC
I was wrong, this is part of guidance. Sorry.
Comment 4 Andrew Crouthamel 2018-09-02 22:18:51 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years and I will be closing this bug.