Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

man userdel: description of -f is confusing #1062

Closed
martinvonwittich opened this issue Aug 6, 2024 · 1 comment · Fixed by #1069
Closed

man userdel: description of -f is confusing #1062

martinvonwittich opened this issue Aug 6, 2024 · 1 comment · Fixed by #1069

Comments

@martinvonwittich
Copy link

man userdel says about the -f flag:

       -f, --force
           This option forces the removal of the user account, even if the user is still logged in. It also forces
           userdel to remove the user's home directory and mail spool, even if another user uses the same home
           directory or if the mail spool is not owned by the specified user.[...]

This seems confusing to me - I want to remove a user who has still processes running, so I think I need the -f flag, but I absolutely do not want to delete the user's home directory. I assume that the description actually means that the combination of -r and -f will delete the user's home directory (even if another user uses the same home), but the description makes it sound as if just specifying -f will cause userdel to delete the home directory.

@alejandro-colomar
Copy link
Collaborator

Agree, the wording should be clarified.

Reading the source code it seems to only remove the checks but not do more than you explicitly asked for.

How about this?:

This option forces the removal of the user account and any other requested actions,
skipping any safety checks.

alejandro-colomar added a commit to alejandro-colomar/shadow that referenced this issue Aug 31, 2024
The previous wording seemed to say that -f implied -r.  It doesn't; -f
only skips safety checks, so reword accordingly.

Closes: <shadow-maint#1062>
Reported-by: Martin von Wittich <[email protected]>
Cc: "Serge E. Hallyn" <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
hallyn pushed a commit that referenced this issue Sep 1, 2024
The previous wording seemed to say that -f implied -r.  It doesn't; -f
only skips safety checks, so reword accordingly.

Closes: <#1062>
Reported-by: Martin von Wittich <[email protected]>
Cc: "Serge E. Hallyn" <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
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 a pull request may close this issue.

2 participants