Skip to content

stty: verify tcsetattr applied all requested settings - #14196

Open
MadeNavaneeth wants to merge 1 commit into
uutils:mainfrom
MadeNavaneeth:fix/stty-tcsetattr-verify
Open

stty: verify tcsetattr applied all requested settings#14196
MadeNavaneeth wants to merge 1 commit into
uutils:mainfrom
MadeNavaneeth:fix/stty-tcsetattr-verify

Conversation

@MadeNavaneeth

Copy link
Copy Markdown
Contributor

Fixes #10324

POSIX allows tcsetattr to succeed while only partially applying requested changes. GNU stty re-reads terminal settings after tcsetattr and compares them to the requested configuration, exiting with an error if they differ.

Previously, uutils called tcsetattr and returned success without verification, which could silently leave the terminal misconfigured (e.g., scripts disabling echo for password input).

This adds a readback-and-compare step after tcsetattr, matching GNU behavior.

POSIX allows tcsetattr to succeed while only partially applying changes.
GNU stty re-reads terminal settings after tcsetattr and compares them to
the requested configuration, exiting with an error if they differ. uutils
previously called tcsetattr and returned success without verification.

Fixes uutils#10324
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/seq/seq-epipe is no longer failing!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stty: no verification that tcsetattr applied all settings

1 participant