Skip to content

cp behaves differently on read-only directories #7961

Description

@suimong

Observe the output of the following:

mkdir -p a/b/c/d
touch a/b/c/d/bar.txt

chmod -R -w a

cp -r a b
uutils-cp -r a c

tree -p a b c

All directories under a and including itself (i.e. a, b, c, d) now has permission 555. (coreutils) cp -r respects readonly flags on directories, thus each subdirectory in this tree b/b/c/d also has permission 555, the same as source a, but each subdirectory in the uutils-cped tree c/b/c/d now has permission 755.

Another observable deviation is that, cp -a a b works as expected, but uutils-cp -a a b will raise permission denied error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions