"test" does not use access syscall for testing permissions
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
Unlike the GNU implementation of coreutils uutils doesn't use access which means ACL's are not taking into account or that root can write into a users home directory:
A simple reproducer:
root@ubuntu:~# ls -lh /home/admin/test.txt
-rw-r--r-- 1 admin admin 4 Jun 29 08:14 /home/admin/test.txt
root@ubuntu:~# test -w /home/admin/test.txt && echo 'write'
write
root@ubuntu:~# /usr/lib/cargo/bin/coreutils/test -w /home/admin/test.txt && echo "write"
root@ubuntu:~#
root@ubuntu:~# /usr/bin/gnutest -w /home/admin/test.txt && echo "write"
write
This issue is reproducible on Ubuntu 26.04 with uutils 0.8.0. The Git main version does not use the access syscall so still suffers from the same issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/uu/test/src/test.rs around the linked line and reproduce the -w example from the issue on Ubuntu. Compare the permission result with GNU test, including ACL and root cases, and inspect existing tests or platform-specific handling nearby. Done means uutils test reports write access consistently with the expected access-check behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100