potential error with adduser

Tito farmatito at tiscali.it
Wed Dec 14 07:10:27 UTC 2016



On 12/14/2016 07:59 AM, Tito wrote:
> On 12/13/2016 04:46 PM, David Henderson wrote:
>> Good morning gang!  Working with the 'adduser' applet and noticed that
>> when specifying the '-H' parameter the /etc/passwd file still gets a
>> home directory value (which doesn't exist in the file system).  Is
>> this an error?  If no home directory was to be made, shouldn't that
>> value be blank?
>>
>> Thanks,
>> Dave
>
> Hi,
> from man adduser on debian:
> "adduser will create a home directory subject to DHOME, GROUPHOMES, and
> LETTERHOMES.  The home directory can be overridden from the command line
> with the --home option"
> In fact we don't support DHOME, GROUPHOMES, and LETTERHOMES but
> use only the user name to create the home directory unless
> the name is specified on the command line with the -H option.
>
>     /* create string for $HOME if not specified already */
>         pw.pw_dir = xasprintf("/home/%s", argv[0]);
>
> We don't support  --no-create-home option at the moment
> but i think it would be easy to add.
>
> Ciao,
> Tito

Sorry, I misunderstood your question and was in a rush.
So let's try to be more accurate this time.
In reality we support the -H option as you correctly
stated:

-H  same as --no-create-home
-h alternative name for home dir rather than user's name

but -H --no-create-home refers only to the creation of the
home dir (the mkdir) not to having it in /etc/passwd:

"Do not create the home directory, even if it doesn't exist"

so i think busybox is doing it correctly.

Sorry for the previous noise.

Ciao,
Tito



More information about the busybox mailing list