Bug#302630: [Pkg-shadow-devel] Bug#302630: useradd not creating home directories

Alexander Gattin Alexander Gattin <arg@online.com.ua>, 302630@bugs.debian.org
Sat, 2 Apr 2005 23:11:45 +0300


--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hi!

retitle 302630 `useradd -d` behaviour could be clarified in manpage
severity 302630 wishlist
tags 302630 +patch
stop

> On Fri, Apr 01, 2005 at 07:45:33PM -0500, Jiann-Ming Su wrote:
> > useradd does not create home directories or groups.  I have found this
> > to be the case on i386, alpha, and mips.
> ...
> This is documented in the man page:
>    The new user account will be entered into the system files as needed,
>    the home directory will be created, and initial files copied, depending
>    on the command line options.

And consequently 302630 is not a bug ;). And IMHO
bug #302630 won't have a right to exist even after
changing its title to something like "useradd manpage
could use some clarification". (154996 has such a
right though... -- well, _maybe_ has).

> Given that you're not the only one who failed to create a home directory,
> I'm wondering if the following sentence should not be added in the manual
> page:
> 
>     By default, useradd does not create the user's home directory.

Maybe, it would be better to change the manpage the
next way instead?:

"The new user account will be entered into the system
files as needed, but everything else like creating home
directory or copying initial files there will only be done
when explicitly requested by specifying corresponding
options on command line."

A bit wordy, though...

> We can also add to the -d option:
> 
>     You can use the -m flag to force the creation of the directory if it
>     does not exist.

or:

      The new user will be created using home_dir as the value for the
      user’s login directory (the directory should exist or -m  should
      be   used).
-- 
WBR,
xrgtn

--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="useradd.8.diff"

--- useradd.8.orig	2005-04-02 22:45:09.000000000 +0300
+++ useradd.8	2005-04-02 22:59:31.000000000 +0300
@@ -51,14 +51,16 @@
 creates a new user account using the values specified on the
 command line and the default values from the system.
 The new user account will be entered into the system files as needed,
-the home directory will be created, and initial files copied, depending
-on the command line options.
+but everything else like creating home directory or copying initial
+files there will only be done when explicitly requested by specifying
+corresponding options on command line.
 The options which apply to the \fBuseradd\fR command are:
 .IP "\fB-c \fIcomment\fR"
 The new user's password file comment field.
 .IP "\fB-d \fIhome_dir\fR"
 The new user will be created using \fIhome_dir\fR as the value for
-the user's login directory.
+the user's login directory (the directory should exist or \fB-m\fR
+should be used).
 The default is to append the \fIlogin\fR name to \fIdefault_home\fR
 and use that as the login directory name.
 .IP "\fB-e \fIexpire_date\fR"

--bg08WKrSYDhXBjb5--