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 4 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)

@SteelCrab
Copy link

I’m interested in this PR and would love to collaborate.
Please let me know which tasks I can take on and what collaboration workflow you prefer. 🙂

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?
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@jacobgc
Copy link
Author

jacobgc commented May 30, 2025

Not really sure why the tests are failing, if anyone has any advice that would be great :)

@sylvestre
Copy link
Contributor

You should run it in verbose mode:

2025-05-30T15:36:33.2756859Z FAIL: tests/cp/existing-perm-dir
2025-05-30T15:36:33.2756934Z ================================
2025-05-30T15:36:33.2756938Z 
2025-05-30T15:36:33.2757056Z FAIL tests/cp/existing-perm-dir.sh (exit status: 1)

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.

3 participants