Skip to content

fix(cp): always create dest dirs with owner write bit before fixing permissions#11318

Merged
RenjiSann merged 1 commit intouutils:mainfrom
baa-ableton:fix/cp-readonly-source-dir
Mar 17, 2026
Merged

fix(cp): always create dest dirs with owner write bit before fixing permissions#11318
RenjiSann merged 1 commit intouutils:mainfrom
baa-ableton:fix/cp-readonly-source-dir

Conversation

@baa-ableton
Copy link
Contributor

@baa-ableton baa-ableton commented Mar 13, 2026

While working on a related bug (nushell#17548), I traced the root cause back to uu_cp itself.

When copying a read-only directory with -p -r, build_dir() creates the destination with the source's read-only permissions. This causes cp to fail with a permission error when it then tries to copy files into it.

@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.

@RenjiSann
Copy link
Collaborator

Thanks you for your contribution !
Small nit before I merge : Could you squash your second commit in the first one ?

@baa-ableton baa-ableton force-pushed the fix/cp-readonly-source-dir branch from d8be0bc to da19515 Compare March 17, 2026 07:47
@baa-ableton
Copy link
Contributor Author

@RenjiSann all done!

@baa-ableton
Copy link
Contributor Author

@RenjiSann
Not sure the one check is failing, Copilot said curl exit code 28 is due to a timeout so 🤷 . Perhaps we should run the check again, please LMK

@RenjiSann RenjiSann force-pushed the fix/cp-readonly-source-dir branch from da19515 to 7801bc0 Compare March 17, 2026 11:19
@RenjiSann
Copy link
Collaborator

I tried to fix the GNU test, but the issue seems to be present on other PRs as well, so I assume this change isn't the cause

@RenjiSann RenjiSann merged commit 8bff321 into uutils:main Mar 17, 2026
159 of 160 checks passed
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.

2 participants