Bug 872267 - "create user" functionality uses libuser incorrectly
Summary: "create user" functionality uses libuser incorrectly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-01 17:00 UTC by Miloslav Trmač
Modified: 2013-05-21 11:56 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-21 11:56:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miloslav Trmač 2012-11-01 17:00:42 UTC
Description of problem:
Reading code of src/virtManagerTui/userworker.py (and running similar test programs):

* Setting libuser.USERPASSWORD directly is not portable; if libuser is configured for a LDAP backend, this will not use the correct format.
* admin.initUser() automatically sets a (locked) shadow password; if a shadow password exists, admin.addUser() overrides libuser.USERPASSWORD to the "password is in /etc/shadow" marker.  In other words, the password setting code code never worked.  (And if it _did_ work, it would set a plaintext password in /etc/passwd!)

For both of the above, the recommended way is to:
1) create an user (which will by default have a locked password), call admin.addUser()
2) then call admin.setpassUser() to set the new password.

* The 'pw_gid' (libuser.GIDNUMBER) attribute of an user contains only the primary group ID.  The API does allow you to pass multiple values, but that's impossible to represent in the backend.  In other words, the code adding the user to the "wheel" group never worked either.

To add a user to the "wheel" group, look up the "wheel" group, and add the user's name to the libuser.MEMBERNAME attribute (without removing the existing values), then call admin.modifyGroup().

Aesthetics:
* The code uses 'pw_*' constants directly instead of using the API-provided names, e.g. libuser.GIDNUMBER.  Both are stable, but using the constants would make it easier to grep libuser users a little.


Version-Release number of selected component (if applicable):
virt-manager-0.9.4-3.fc19.src.rpm

Comment 1 Fedora End Of Life 2013-04-03 14:17:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 2 Cole Robinson 2013-05-21 11:56:57 UTC
virt-manager-tui, the only libuser code, was dropped upstream and is not in current F19, so this is 'fixed'


Note You need to log in before you can comment on or make changes to this bug.