Bug 213569

Summary: usermod not moving home directory
Product: [Fedora] Fedora Reporter: Steven Stromer <filter>
Component: shadow-utilsAssignee: Peter Vrabec <pvrabec>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6Keywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 4.0.17-8.fc6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-03 09:42:47 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 Steven Stromer 2006-11-02 00:37:47 UTC
Apologies for listing the component as 'basesystem', but I could find no entry for 'usermod', and I am 
not sure which component it is a part of, if not its own. As I don't know what component this is a part 
of, I can't give a component version. However, this is a fresh install of FC6.

On a fresh install of FC6:
usermod -d /home/subdir/[accountname] -m [username]

seems to execute without error, but neither creates the directory /home/subdir/[accountname], nor 
moves any of the files from the original location of /home/[accountname]. It does change the account's 
settings to point to /home/subdir/[accountname] as the location of the account's home directory. So, it 
seems like the -d switch is working, and it is the -m switch that is not performing properly.

FYI, the /home/subdir directory already exists, and I've tried creating the directory /home/subdir/
[accountname], and then executing usermod as above, all with the same results.

I posted this to fedora users newsgroup. Others felt this is a bug, as well.

Comment 1 Peter Vrabec 2006-11-02 13:48:48 UTC
I can't reproduce it.

original state
# ll
drwx------  3 foo1     foo1     4096 Nov  2 14:22 foo1
# grep foo /etc/passwd
foo1:x:502:502::/home/foo1:/bin/bash

try "-d" option
# usermod -d /home/foo2 foo1
# ll
drwx------  3 foo1     foo1     4096 Nov  2 14:22 foo1
# grep foo /etc/passwd
foo1:x:502:502::/home/foo2:/bin/bash
---------> OK

revert change
# usermod -d /home/foo1 foo1
# grep foo /etc/passwd
foo1:x:502:502::/home/foo1:/bin/bash
---------> OK

finally use together with "-m" option
# usermod -d /home/foo2 -m foo1
# ll
drwx------  3 foo1     foo1     4096 Nov  2 14:22 foo2
# grep foo /etc/passwd
foo1:x:502:502::/home/foo2:/bin/bash
---------> OK


Comment 2 Steven Stromer 2006-11-02 19:11:22 UTC
I have updated shadow-utils based on last night's update (11/1/06) to shadow-utils.i386 4.0.17-8.fc6 
and usermod now works properly, as you describe. However, in either the version that ships with FC6, 
shadow-utils - 2:4.0.17-5.i386,  or an interim version (2:4.0.17-6 or 2:4.0.17-7, if they exist) the -m 
switch DID NOT WORK. I have to believe that you tested after last night's update. Please feel free to reclose 
this; I just want to document for others.

Comment 3 Peter Vrabec 2006-11-03 09:42:47 UTC
I don't know how  it is possible. There isn't any change in 4.0.17-8.fc6, 
which might affect this issue.