-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Environment: Ubuntu 24.04, uutils main branch (git commit 0eab0fa), GNU coreutils v9.4
Steps to reproduce:
mkdir -p a/b
touch a/b/file
chmod a-w a/b
rm -rf a
What happens now: uutils rm terminates with an error message about the top level directory:
rm: cannot remove 'a': Permission denied
What I expected to happen: GNU rm terminates with an error message about the innermost file:
rm: cannot remove 'a/b/file': Permission denied
Notes: this should cause a failure in GNU test file tests/rm/cycle.sh, but we are replacing the a/b/file in the expected error message with a
Line 204 in 0eab0fa
| sed -i -e "s|rm: cannot remove 'a/b/file'|rm: cannot remove 'a'|g" tests/rm/cycle.sh |
cannot remove 'a' is misleading, and the original GNU error message seems to better match the conceptual model of how rm -r should work: it is a post-order tree traversal, and the leaf node cannot be removed because its parent directory does not allow writes.