Bug 213569 - usermod not moving home directory
Summary: usermod not moving home directory
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 6
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
Keywords: Reopened
Depends On:
TreeView+ depends on / blocked
Reported: 2006-11-02 00:37 UTC by Steven Stromer
Modified: 2007-11-30 22:11 UTC (History)
0 users

Clone Of:
Last Closed: 2006-11-03 09:42:47 UTC

Attachments (Terms of Use)

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

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

revert change
# usermod -d /home/foo1 foo1
# grep foo /etc/passwd
---------> 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
---------> 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.

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