Skip to content

rm: Directory not empty when a subdirectory does not have read permission #10966

@e-kwsm

Description

@e-kwsm

5d03f63

similar to #9479 but in this case read permission is not granted:

# set up
tmp=$(mktemp -d -p /tmp)
cd "$tmp"
mkdir -p foo/bar
touch foo/bar/baz
# unset permission
chmod ugo-r foo/bar

# GNU and BSD report origin
gnurm -rf foo
# gnurm: cannot remove 'foo/bar': Permission denied
bsdrm -rf foo
# bsdrm: foo/bar: Permission denied
# bsdrm: foo: Directory not empty

# but uutils does not
uu-rm -rf foo
# uu-rm: cannot remove 'foo': Directory not empty

uu-rm -rf foo/bar  # as expected
# uu-rm: cannot remove 'foo/bar': Permission denied

# tear down
chmod -R u+rwx "$tmp"
rm -rf "$tmp"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions