Jason Franklin <ja...@oneway.dev> writes:

> I am a developer who is new to making contributions to Debian.  Most of
> my work so far has been focused on making improvements to the "adduser"
> package.  Of course, bug triage is one of the first things on which I am
> trying to show progress.

> On the relevant BTS page, I came across this bug:

>   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=152195

> A summary of this bug is below...

>   # adduser --system --no-create-home foo
>   # getent passwd foo
>   foo:x:130:65534::/home/foo:/usr/sbin/nologin

> As you can see, "/home/foo" is named as the new user's home directory,
> but that directory is not created due to the "--no-create-home" option.

> This was reported many years ago and was given the "wontfix" tag.

I don't think this is a bug at all and should just be closed.  I believe
people are misunderstanding what --no-create-home means.

The point of the --no-create-home option is that the administrator wants
to handle the home directory creation themselves rather than have adduser
do it.  This is common when /home comes from a shared network file system,
for example, where adduser will likely not have permissions to create the
home directory.  It can also come up in other situations, such as
automounted home directories.

The documentation says simply:

       --no-create-home
              Do not create the home directory, even if it doesn't exist.

Passing --no-create-home therefore does not *change* the home directory,
and should not change the home directory, since that would defeat its
entire purpose.  The home directory is still set the same as before,
including any defaults.  adduser just doesn't try to create it or check if
it exists, because this should be handled external to adduser.

If a user should have a nonexistent home directory, --home /nonexistent
should be passed to adduser.

-- 
Russ Allbery (r...@debian.org)              <https://www.eyrie.org/~eagle/>

Reply via email to