coreutils
coreutils copied to clipboard
timeout: Should not accept "character" input (e.g. `'0`)
This might end up getting handled by #7675, but just to make sure we don't forget.
uutils timeout accepts '1 or "1 as parameters, interpreting them as ASCII values (49 seconds):
cargo build -p uu_timeout && time ./target/debug/timeout \'1 cat
...
real 0m49.055s
We should not allow that:
$ env timeout \'1 cat
timeout: invalid time interval ‘'1’
Try 'timeout --help' for more information.
Confirmed that #7675 fixes this, but we don't have any test coverage, so it'd be best to add a few tests before we close this (at least some end-to-end in timeout and sleep?).
@Qelxiros let me know if you want to do this, otherwise I'll look at it after the pending PR are merged.
I can do this, but it might not be for a day or two. I want to prioritize my work in findutils at the moment; I think I'm getting close to an MVP.
@drinkcat can this be closed ?
This actually affects multiple utils, not just timeout (anything with a format string; e.g., seq has the same problem). I'm adding a more complete fix is in #7209.
Huh I would have sworn that GNU seq accepted those character values ('0), but I think you're right, only printf does?