bug(pr): does not error out when the file is /dev/vhost-net
Open
Nobody has claimed this yet.
U - pr
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
Hi, uutils mainteners
we uncovered another issue with the pr utility, it returns 0 status code and no errors, as our testing confirms when the file is /dev/vhost-net
relunsec@relunsec:~/software/coreutils/target/debug$ sudo gnupr /dev/vhost-net
gnupr: /dev/vhost-net: File descriptor in bad state
relunsec@relunsec:~/software/coreutils/target/debug$ sudo ./pr /proc/self/mem
pr: Input/output error (os error 5)
relunsec@relunsec:~/software/coreutils/target/debug$ sudo ./pr /dev/vhost-net
relunsec@relunsec:~/software/coreutils/target/debug$ echo $?
0
relunsec@relunsec:~/software/coreutils/target/debug$
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 by locating the Rust implementation and tests for the pr command, then reproduce the behavior with /dev/vhost-net and compare it with GNU pr and the /proc/self/mem case shown here. Done means pr reports the file error and exits 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