Skip to content

cp: Initial fix to matching GNU coreutils when copying folder that is read only #8023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jacobgc
Copy link

@jacobgc jacobgc commented May 28, 2025

This is my initial attempt at fixing #7961. I'm fairly certain this isn't the correct way of doing this, so I'm very much open to ideas on how I could implement this better

This now produces the exact same output as GNU coreutils tested with:

pushd $(mktemp -d)
mkdir -p a/b/c/d
touch a/b/c/d/bar.txt

chmod -R -w a

cp -r a coreutils
uutils-cp -r a uutils

tree -p a coreutils uutils
popd

It also matches if use the flags --preserve mode and --no-preserve mode. This does not fix the issue when using -a or -p but I plan on looking at that next.

Copy link

GNU testsuite comparison:

GNU test failed: tests/cp/existing-perm-dir. tests/cp/existing-perm-dir is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

GNU test failed: tests/cp/existing-perm-dir. tests/cp/existing-perm-dir is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant