bug(sync): sync ignores errors handling when the file is /proc/self/mem and /dev/full
Open
Nobody has claimed this yet.
U - sync
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
Hi, uutils mainteners
very weird bug that should not happen but does, when using /proc/self/mem the uutil sync ignore errors, but gnu one errors out, and the uutils one exit with a misleading 0 status exit code as the testing confirms
relunsec@relunsec:~/software/coreutils/target/debug$ gnusync /proc/self/mem
gnusync: error syncing '/proc/self/mem': Invalid argument
relunsec@relunsec:~/software/coreutils/target/debug$ ./sync /proc/self/mem
relunsec@relunsec:~/software/coreutils/target/debug$ echo $?
0
relunsec@relunsec:~/software/coreutils/target/debug$
relunsec@relunsec:~/software/coreutils/target/debug$ ./sync /dev/full
relunsec@relunsec:~/software/coreutils/target/debug$ gnusync /dev/full
gnusync: error syncing '/dev/full': Invalid argument
relunsec@relunsec:~/software/coreutils/target/debug$
as you can the uutils status code is 0 and ignores handling errors
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 with the sync command's error handling and reproduce the reported cases using /proc/self/mem and /dev/full, comparing its output and status with GNU sync. Done means these inputs report the sync error and exit with a nonzero status instead of silently returning 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100