summaryrefslogtreecommitdiff
path: root/src/rm.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-10-04 13:43:32 +0100
committerPádraig Brady <P@draigBrady.com>2016-10-04 23:35:59 +0100
commit0e060d9fef64727aa2d41f00f8217c61166bb2e0 (patch)
treefae045097daf523f4071f18ab633666653dc27ab /src/rm.c
parentf04daf570b91286d47a80074cf4a6a63c4309dc0 (diff)
downloadcoreutils-0e060d9fef64727aa2d41f00f8217c61166bb2e0.tar.xz
rm: disallow --n alias for --no-preserve-root
* src/rm.c (main): Ensure the full --no-preserve-root option is specified, rather than allowing --n etc. * tests/rm/r-root.sh: Add a test case. * NEWS: Mention the change in behavior. Improved by Jim Meyering. Fixes http://bugs.gnu.org/24604
Diffstat (limited to 'src/rm.c')
-rw-r--r--src/rm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rm.c b/src/rm.c
index 13a5714c3..2c54405f7 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -287,6 +287,9 @@ main (int argc, char **argv)
break;
case NO_PRESERVE_ROOT:
+ if (! STREQ (argv[optind - 1], "--no-preserve-root"))
+ error (EXIT_FAILURE, 0,
+ _("you may not abbreviate the --no-preserve-root option"));
preserve_root = false;
break;