]> git.ipfire.org Git - thirdparty/coreutils.git/commit
stty: ensure no side effects from invalid options
authorPádraig Brady <P@draigBrady.com>
Mon, 9 Jan 2017 00:07:42 +0000 (00:07 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 9 Jan 2017 00:27:07 +0000 (00:27 +0000)
commit9c0a3a27f70bbb27e839404571922b0f8f0d48da
tree4d2d6c9857321db2a9b45b23c9485bd555cccc13
parent229431d63caf2dcb411da565a9fc7e51fa2ac809
stty: ensure no side effects from invalid options

* src/stty.c (apply_settings): A new function refactored
from main() that is used to both check and apply options.
(main): Call apply_settings before we open the device,
so all validation is done before interacting with a device.
* NEWS: Mention the improvement.
* tests/misc/stty.sh: Add a test case.
NEWS
src/stty.c
tests/misc/stty.sh