Skip to content
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

shred: fix permissions_set_readonly_false clippy error #4488

Merged
merged 1 commit into from
Mar 12, 2023

Conversation

miles170
Copy link
Contributor

@miles170 miles170 commented Mar 10, 2023

Closes #4487

@miles170 miles170 marked this pull request as draft March 10, 2023 08:50
@miles170 miles170 force-pushed the fix-shred-clippy branch 5 times, most recently from 9e022d6 to c4cce9f Compare March 10, 2023 09:51
@miles170 miles170 marked this pull request as ready for review March 10, 2023 10:01
src/uu/shred/src/shred.rs Outdated Show resolved Hide resolved
src/uu/shred/src/shred.rs Outdated Show resolved Hide resolved
@tertsdiepraam
Copy link
Member

tertsdiepraam commented Mar 10, 2023

I have only sets the write access for the owner on UNIX platform, not sure should it sets to group or others?

You can test it:

❯ ls -l test
---------- 1 terts terts 77824 10 mrt 11:29 test
❯ shred test
shred: test: failed to open for writing: Permission denied
❯ shred test -f
❯ ls -l test
--w------- 1 terts terts 77824 10 mrt 11:31 test

For some more evidence, here's the strace output that I think is responsible:

openat(AT_FDCWD, "test", O_WRONLY|O_NOCTTY) = -1 EACCES (Permission denied)
chmod("test", 0200)                     = 0
openat(AT_FDCWD, "test", O_WRONLY|O_NOCTTY) = 3

In contrast, here's strace for the current uutils main branch:

chmod("test", 0100666)                  = 0

@miles170 miles170 force-pushed the fix-shred-clippy branch 8 times, most recently from f15e344 to 9ba14fc Compare March 11, 2023 05:20
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

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.

shred.rs: error: call to set_readonly with argument false
3 participants