Bug 235533

Summary: system-config-users throws an exception if passwd file contains invalid utf-8
Product: [Fedora] Fedora Reporter: Ray Strode [halfline] <rstrode>
Component: system-config-usersAssignee: Nils Philippsen <nphilipp>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: triage
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-08 09:38:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ray Strode [halfline] 2007-04-06 19:26:00 UTC
So, yesterday I fixed bug 235351 in GDM where it would crash if /etc/passwd
contained non-utf8 characters.

Today I went to system-config-users to delete the test user I created yesterday
and a few other test users I had on my laptop and it crashed, too. :-)

The output is:
Traceback (most recent call last):
  File "/usr/share/system-config-users/system-config-users.py", line 46, in <module>
    mainWindow.mainWindow()
  File "/usr/share/system-config-users/mainWindow.py", line 269, in __init__
    self.refresh()
  File "/usr/share/system-config-users/mainWindow.py", line 430, in refresh
    self.populate_lists()
  File "/usr/share/system-config-users/mainWindow.py", line 521, in populate_lists
    self.populate_user_list()
  File "/usr/share/system-config-users/mainWindow.py", line 461, in
populate_user_list
    gecos = unicode (gecos, 'utf-8')
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3: unexpected
end of data

The easiest fix is probably to add a third argument 'replace' to make it add
unicode "i don't know what this" characters instead of throwing an exception.

Or if you were feeling extra motivated you could try converting from some of the
most popular encodings out there and converting to utf8, but that doesn't seem
worth the effort.

Comment 1 Bug Zapper 2008-04-03 23:59:30 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 2 Bug Zapper 2008-05-07 01:26:46 UTC
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

Comment 3 Nils Philippsen 2008-05-08 09:17:15 UTC
1.2.80 with the fix you outlined above is building for F10 right now.