On Tue, Jun 07, 2022 at 06:18:48PM -0400, Matt Barry wrote:
> One thing that is unclear (and I could not find guidance in the
> documentation) is what the intent towards mount points actually is.

I think the docs are inconclusive here. We should clarify the docs first
and then implement the documented behavior.

Is --remove-home expected to remove the entire home directory regardless
whether the home directory contains files owned by other users? If so,
our documentation that --remove-all-files makes --remove-home effectless
is wrong: --remove-all-files will leave a root:root file
/home/ouruser/bar intact file --remove-home will remove that file, thus
--remove-all-files --remove-home has different semantics than
--remove-all-files alone.

Inspecting deluser starting line 266 raises the question why
--remove-all-files goes through a number of motions to select file types
while --remove-home doesn't.

I think that we should remove the connections between --remove-home and
--remove-all-files and do both deletions after each other.

I think that --remove-home should:
- remove everything under /home/ouruser
- not honor NO_DEL_PATHS
- unconditionally descend into mount points und /home/ouruser
- not honor EXCLUDE_FSTYPES
- leave the mount points under /home/ouruser in place, printing a
  diagnostic in that case (and continue)

--remove-all-files should:
- start at /
- prune matches in NO_DEL_PATHS
- prune mountpoints with a mounted filesystem type in EXCLUDE_FSTYPES
- remove regular files and symlinks belonging to our user
- remove empty directories belonging to our user
- I am unsure how to handle block/character special files, sockets,
  pipes

Otoh, I think that --remove-all-files is a misfeature in the first place
and we should think seriously about deprecating it. It has gazillions of
corner cases and solving all of them is a major hassle.

What do you think?

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply via email to