Bug 135280

Summary: hang & corruption when renaming a user
Product: [Fedora] Fedora Reporter: Andrew D. Stadler <stadler>
Component: system-config-usersAssignee: Nils Philippsen <nphilipp>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 2CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-23 16:51:57 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 Andrew D. Stadler 2004-10-11 18:22:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
I created a user account and learned later the user wished for a
different spelling.  I launched system-config-users and selected the
user in question and "properties".

Under the "User Data" tab I retyped the users name and I also changed
the home directory name.  I clicked "OK".  The hourglass is still
turning, 5 minutes later.

Poking around the terminal (which s-c-u contines to spin), I've
determined that:

- in /etc/passwd and /etc/shadow, login and home have been renamed
- in /etc/passwd- and /etc/shadow-, no changes
- /etc/group and /etc/gshadow have not been updated
- the home directory has not been renamed.

Essentially, the account is now "broken" and I'm going to have to use
superuser text editing skills to repair it.  So I'm filing this as
"high priority / data loss" because the GUI tool has easily broken a
user's account.



Version-Release number of selected component (if applicable):
system-config-users-1.2.13-1

How reproducible:
Didn't try

Steps to Reproduce:
1.  open system config users
2.  select a user and "properties"
3.  try to rename the user and their home dir
    

Actual Results:  (1) s-c-u hangs (hourglass tumbling)
(2) incomplete changes render the account "broken"

Expected Results:  it should be possible to correctly rename an
account, -or- it should be completely disallowed.  As is, it appears
to have corrupted this account.

Additional info:

Comment 1 Nils Philippsen 2004-10-11 19:47:45 UTC
Andy, I tried this with the same results. Because I was running it
from the command line, I got a python traceback which indicates that
this is some kind of a libuser problem:

Traceback (most recent call last):
  File "/usr/share/system-config-users/userProperties.py", line 512,
in on_ok_button_clicked
    self.parent.ADMIN.modifyUser(self.userEnt)
RuntimeError: unknown error

Andy, please tell us which version of libuser you have.

Miloslav, should s-c-users (and in turn libuser) allow changing
username and/or home directory or should we block it?

Comment 2 Andrew D. Stadler 2004-10-11 19:53:20 UTC
I'm running a pretty much up2date version of FC, the specific libuser is

libuser-0.51.7-7.1.1

Comment 3 Miloslav Trmač 2004-10-11 21:01:22 UTC
The RuntimeError is a duplicate of #78376 and #121252, and
fixed in libuser >= 0.51.10.

The more general problems:
* ADMIN.modifyUser doesn't move the home directory by default,
  contrary to documentation.
* the home directory move functionality actually can't work right now;
  it doesn't remember the old home directory.
* libuser is working on a per-entity basis, so renaming of group
  entries (including the private group) has to be done by s-c-users.

So,
* I'll fix home directory moving and fix modifyUser documentation
  (rather than change modifyUser default)
* Once that is done, s-c-users can call ADMIN.modifyUser(..., True),
  and Require: a fixed version of libuser.
* s-c-users should rename the user in all user's supplementary groups
  and rename user's private group, if any.
Sounds good, Nils?

Comment 4 Nils Philippsen 2004-10-12 06:46:49 UTC
Sounds very good, especially because that means getting a fix for this
other python interface problem we had lately for FC2, i.e. I can get
the fix in that if possible uid == gid for new users.

I guess for s-c-users this means:

- When renaming the home, just trust on libuser to do the right thing
- When renaming a user, take care of the group entities so they don't
have the old user name
- When renaming a group, everything should be OK because users are
either already listed with the group (when it's secondary) or the
group is referenced by GID which doesn't change.

Right?

Comment 5 Miloslav Trmač 2004-10-12 07:27:19 UTC
Right.

Fixed libuser is libuser-0.52.5-1.

(BTW: libuser renames home directories by copying them and then
removing the original; fixing this can probably wait post-FC3.)

Comment 6 Nils Philippsen 2004-10-12 08:57:03 UTC
Miloslav, can you then pipe a "libuser-0.52.5-0.fc2.1" or so through
the build system for FC2? Thanks.

Comment 7 Miloslav Trmač 2004-10-13 07:49:28 UTC
libuser-0.52.5-0.FC2.1 is published now.

Comment 8 Nils Philippsen 2004-10-13 15:54:10 UTC
system-config-services-1.2.25-0.fc2.1 containes the needed changes for
renaming users.