dd: a zero factor no longer short-circuits the multiplier
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with parse_bytes_with_opt_multiplier and the change from 7f9b9a6f0, then inspect the failing case in tests/dd/misc.sh. Compare the zero-factor behavior with GNU coreutils 9.10 and verify that an oversized later factor is not rejected after a zero factor. The separate failed-seek difference is outside this issue.
Written by the indexing model from the issue text.
Description
GNU dd stops at the zero factor in a multiplier expression and never looks at
the rest. We now parse every factor first, so a huge one fails before the zero
is taken into account:
$ LC_ALL=C dd count=00x9999999999999999999999999999999999999999999999999999999999999 </dev/null
uutils: dd: invalid number: '00x999…': Value too large for defined data type
exit=1
GNU: 0+0 records in
0+0 records out
0 bytes copied, 1.627e-05 s, 0.0 kB/s
exit=0
This makes tests/dd/misc.sh fail.
It started with 7f9b9a6f0 ("dd: reject a number that does not fit in u64"),
which turned ParseSizeError::SizeTooBig into an error instead of u64::MAX
in parse_bytes_with_opt_multiplier. The zero factor case wasn't covered.
Note that fixing this alone doesn't make tests/dd/misc.sh pass the test then
reaches a second difference, dd: failed to seek in output file: Illegal seek.
Compared against GNU coreutils 9.10.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 371
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.
More from uutils/coreutils
-
U - ls
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
U - ls
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
U - tr
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
U - date
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
U - date
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
All issues in uutils/coreutils
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·