]> git.ipfire.org Git - thirdparty/coreutils.git/commit
rm: add --preserve-root=all to protect mounts
authorPádraig Brady <P@draigBrady.com>
Mon, 11 Jun 2018 06:02:58 +0000 (23:02 -0700)
committerPádraig Brady <P@draigBrady.com>
Thu, 21 Jun 2018 04:18:32 +0000 (21:18 -0700)
commitc932e5c9ec7e8bac318179206ec01b11942efd3d
tree47eb220593a52dcad67111c0a91ad08a77772a0f
parent163df41d45bcc6615915ca507264dde090aba44d
rm: add --preserve-root=all to protect mounts

* src/remove.c (rm_fts): With the --preserve-root=all extension,
reject command line arguments that are mount points.
* src/remove.h (rm_options): Add preserve_all_root to store config.
* src/mv.c (rm_option_init): Init preserve_all_root to false.
* src/rm.c (main): Init preserve_all_root as per option.
(usage): Describe the new option.
* src/remove.c (rm_fts): Lookup the parent device id,
and reject the cli argument if a separate file system.
* tests/rm/one-file-system.sh: Add a test case.
* NEWS: Mention the new feature.
NEWS
doc/coreutils.texi
src/mv.c
src/remove.c
src/remove.h
src/rm.c
tests/rm/one-file-system.sh