Subject: admin/11707: usermod doesn't move home directory and -m does work as documented
To: None <>
From: None <>
List: netbsd-bugs
Date: 12/12/2000 10:30:22
>Number:         11707
>Category:       admin
>Synopsis:       usermod doesn't move home directory and -m does work as documented
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    netbsd-admin
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 12 10:30:01 PST 2000
>Originator:     John Maier
>Release:        NetBSD 1.5 release
NetBSD newmail 1.5 NetBSD 1.5 (MAIL) #6: Tue Dec  5 10:03:39 CST 2000     root@newmail:/usr/src/sys/arch/i386/compile/MAIL i386

usermod is unable to move the original home director to the new home directory. (see example in How to repeat the problem)

I omited the -m option and it still trys to move the directory, which seem counter to what the man page says.

-m      moves the home directory from its old position to the new one.


-d home-directory
             is the home directory which will be created and populated for the
             user, should the -m option be specified.

It seems to me that the manpage implies that if the -m option is omited the directory isn't moved, but never specifies what happens to the directory specified my -d.  A new /etc/skel/.* populated directory is created?

I was going to submit this as a admin bug and a doc bug, but I think they are too related.
I have this test account jmaier, I want to move it to jmaiera so...

$ usermod -v -m -d/usr/home/jmaiera -ljmaiera jmaier
Command: /bin/mv /usr/home/jmaiera /usr/home/jmaiera
mv: rename /usr/home/jmaiera to /usr/home/jmaiera: No such file or directory
usermod: [Warning] can't system `/bin/mv /usr/home/jmaiera /usr/home/jmaiera'
usermod: can't move `/usr/home/jmaiera' to `/usr/home/jmaiera': Inappropriate ioctl for device

I'm just scripting around the problem for now.