[SRU] Mugshot fails to start for some users
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mugshot |
Fix Released
|
High
|
Unassigned | ||
mugshot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
New
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Because of incomplete logic for collecting user details, Mugshot < 0.2.5 may
fail to start for some users. As of version 0.2.5, user details are pulled
from several sources including LibreOffice, passwd, and GLib. In this way,
the following critical errors are avoided.
Traceback (most recent call last):
File "/usr/lib/
first_name, last_name = name.split(' ', 1)
UnboundLocalError: local variable 'name' referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/mugshot", line 35, in <module>
mugshot.main()
File "/usr/lib/
window = MugshotWindow.
File "/usr/lib/
new_
File "/usr/lib/
self.
File "/usr/lib/
first_name = name
UnboundLocalError: local variable 'name' referenced before assignment
[Test Case]
If you have an LDAP-configured account...
1. Start Mugshot.
Otherwise...
1. Set your account name to "A".
2. Start Mugshot.
[Expected Results]
Mugshot should start successfully.
[Regression Potential]
None. This new release adds several safeguards to prevent future similar issues.
Changed in mugshot: | |
status: | New → Fix Committed |
milestone: | none → 0.2.5 |
importance: | Undecided → High |
Changed in mugshot (Ubuntu): | |
status: | New → Fix Released |
Changed in mugshot: | |
status: | Fix Committed → Fix Released |
summary: |
- mugshot produces python errors + [SRU] Mugshot fails to start for some users |
description: | updated |
Hello Owen,
I experienced the same issue with LDAP users. But it works with local users.
Reading the lines above 252 in MugshotWindow.py, it can be seen that the program only looks in the passwd file to get user info, and doesn't expect the user to be outside of it. That's why it crashes.
The program should use "getent passwd username" or an equivalent for Python to get user information.
It should inform the user, too, it can't handle distant users.
As a dirty patch, you could add those two lines after the instruction "break" at line 248:
name, office, office_phone, home_phone = 'User Unknown', '', '', ''
else:
It displays the right dialog, though you can't validate any changes.
Xubuntu 14.04 amd64, mugshot 0.2.3-1, python3 3.4.0-0ubuntu2