Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout/uucore: Should accept all casings of signal name #6381

Open
BenWiederhake opened this issue May 7, 2024 · 0 comments · May be fixed by #6382
Open

timeout/uucore: Should accept all casings of signal name #6381

BenWiederhake opened this issue May 7, 2024 · 0 comments · May be fixed by #6382

Comments

@BenWiederhake
Copy link
Collaborator

kill accepts signal names regardless of the casing: #6217

timeout accepts signal names regardless of the casing (this issue):

$ cargo run -q --features timeout timeout -s TeRm 0.1 sleep 999
timeout: 'TeRm': invalid signal
Try 'target/debug/coreutils timeout --help' for more information.
[$? = 125]
$ timeout -s TeRm 0.1 sleep 999
[$? = 124]

env accepts signal names regardless of the casing (found while reviewing #6377):

$ env --ignore-signal=tErM sleep 0.1
$ env --ignore-signal=invalid sleep 0.1 # and it really tries to parse it!
env: 'invalid': invalid signal
Try 'env --help' for more information.
[$? = 125]

That's all current (and probably all future) callers of uucore::signals::signal_by_name_or_value (uucore/src/lib/features/signals.rs:342). Therefore, I suggest that we change the implementation of signal_by_name_or_value to accept any casing, which would simplify kill, fix timeout, and prevent a bug in env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant