Bug 213569 - usermod not moving home directory
usermod not moving home directory
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
6
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-01 19:37 EST by Steven Stromer
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 4.0.17-8.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-03 04:42:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Steven Stromer 2006-11-01 19:37:47 EST
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 08:48:48 EST
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 14:11:22 EST
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 04:42:47 EST
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.