Skip to content

Comments

Clarify documentation regarding creation of homedir#1523

Open
septatrix wants to merge 1 commit intoshadow-maint:masterfrom
septatrix:patch-1
Open

Clarify documentation regarding creation of homedir#1523
septatrix wants to merge 1 commit intoshadow-maint:masterfrom
septatrix:patch-1

Conversation

@septatrix
Copy link

The "for non-system users" only applies to the CREATE_HOME config and is does not matter when using the -m flag.

Fixes #1522.

podman run --rm -it fedora:44
[root@cae89bd5de3c /]# ls -l /home/
total 0
[root@cae89bd5de3c /]# grep CREATE_HOME /etc/login.defs
CREATE_HOME     yes
[root@cae89bd5de3c /]# useradd --system foo
[root@cae89bd5de3c /]# useradd --system --create-home bar
[root@cae89bd5de3c /]# ls -l /home/
total 0
drwx------. 1 bar bar 64 Jan 30 01:39 bar

The "for non-system users" only applies to the CREATE_HOME config
and is does not matter when using the `-m` flag.
@septatrix
Copy link
Author

I desired I can add a Signed-Off tag tomorrow, I just did this quickly via the GH web UI as I'm calling it a day right now.

Copy link
Collaborator

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is an improvement the text is still quite confusing. I'd propose to make a complete rewrite of this section to clarify the beaviour by separating it by user type.

My proposal would be the following:

Home directory creation behavior:

The directory HOME_DIR is not created by default. Whether it gets created depends on the user type and command-line options:
- For regular users: the home directory will be created if either the -m flag is specified or if CREATE_HOME is set to yes in /etc/login.defs.
- For system users (created with -r): the home directory will only be created if the -m flag is explicitly specified, regardless of the CREATE_HOME setting.
- Override: the -M flag prevents home directory creation in all cases, overriding any other settings.

Feel free to reword or improve anything as it might contain errors.

<option>-m</option> flag is specified or
<replaceable>CREATE_HOME</replaceable> in
<filename>login.defs</filename> is set to true. However, it will never
default. It will only be created if the <option>-m</option> flag
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alejandro-colomar
Copy link
Collaborator

While this is an improvement the text is still quite confusing. I'd propose to make a complete rewrite of this section to clarify the beaviour by separating it by user type.

My proposal would be the following:

Home directory creation behavior:

The directory HOME_DIR is not created by default. Whether it gets created depends on the user type and command-line options:

#1523 (comment)

I have some wording tweaks for the following suggested text:

  • For regular users: the home directory will be created if either the -m flag is specified or if CREATE_HOME is set to yes in /etc/login.defs.

s/the home directory/it/

s/specified or if/specified, or/

s,/etc/login.defs,login.defs(5),

  • For system users (created with -r): the home directory will only be created if the -m flag is explicitly specified, regardless of the CREATE_HOME setting.

s/will only be created if/will be created only if/

s/(created with -r)/(-r)/

  • Override: the -M flag prevents home directory creation in all cases, overriding any other settings.

s/Override: the/The/


Feel free to reword or improve anything as it might contain errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing phrasing in useradd manpage for --home-dir flag

3 participants