Skip to content

cp -a still fails with readonly directories (follow-up to #7961) #10787

@sylvestre

Description

@sylvestre

PR #10529 fixed cp -r but cp -a still fails with "Permission denied" on readonly directories.

Reproduction

sudo rm -rf test_a test_gnu
mkdir -p test_a/b && touch test_a/b/file.txt && chmod -R -w test_a

# GNU cp -a (works)
/usr/bin/cp -a test_a test_gnu
echo $?
# 0
stat --format=%a test_gnu
# 555

sudo  rm -rf test_a test_gnu

mkdir -p test_a/b && touch test_a/b/file.txt && chmod -R -w test_a
# uutils cp -a (fails)
cargo run --features unix -q -- cp -a test_a test_uutils_a
# cp: Permission denied (os error 13)
echo $?
# 1

output:

0
555
cp: Permission denied (os error 13)
1

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