Skip to content

Conversation

@bjorn3
Copy link
Collaborator

@bjorn3 bjorn3 commented Dec 9, 2025

This way redirecting stdio to another tty won't be treated as if stdio
isn't redirected at all.

This matches newer ogsudo versions.

Also introduced a SafeTty trait to ensure a bunch of methods that invoke ioctls only get called on known real ttys.

Fixes #1377

@bjorn3 bjorn3 requested a review from squell December 9, 2025 16:05
@squell squell added this to the sudo changes milestone Dec 10, 2025
@bjorn3
Copy link
Collaborator Author

bjorn3 commented Dec 10, 2025

Pushed a commit to port sudo-project/sudo@78b7121 too.

@squell squell added the C-operatingsystem Low-level glue layers label Dec 11, 2025
@squell
Copy link
Member

squell commented Dec 15, 2025

I've created #1390 to remind us to write an integration test for the OFLAG commit that was piggy-backed on this PR.

@squell
Copy link
Member

squell commented Dec 15, 2025

Note:I think the matches_pgrp function can be slightly better named (something like is_terminal_for_pgrp), as discussed, but that is not a blocker for merging.

squell
squell previously approved these changes Dec 15, 2025
@squell
Copy link
Member

squell commented Dec 15, 2025

Maybe also an integration test that demonstrates the behaviour?

This way redirecting stdio to another tty won't be treated as if stdio
isn't redirected at all.

This matches newer ogsudo versions.
Copy link
Member

@squell squell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the commits that re-introduce missing keystrokes, and introduce the “oflag” feature this looks good to me.

@squell squell merged commit df0a472 into trifectatechfoundation:main Dec 16, 2025
17 checks passed
@bjorn3 bjorn3 deleted the tty_pgid_check branch December 16, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-operatingsystem Low-level glue layers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check if stdio tty is actually our own tty

2 participants