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

pty: Make forkpty() unsafe #1390

Merged
merged 1 commit into from
Feb 21, 2021
Merged

pty: Make forkpty() unsafe #1390

merged 1 commit into from
Feb 21, 2021

Conversation

tavianator
Copy link
Contributor

After the child returns from a fork() of a multi-threaded process, it is
undefined behaviour to call non-async-signal-safe functions according to
POSIX. Since forkpty() is implemented in terms of fork(), those
restrictions should apply to it too.

Fixes #1388

@asomers
Copy link
Member

asomers commented Feb 20, 2021

Thanks for the PR! This looks good, but you will have to rebase. Otherwise git will mismerge the CHANGELOG.

After the child returns from a fork() of a multi-threaded process, it is
undefined behaviour to call non-async-signal-safe functions according to
POSIX.  Since forkpty() is implemented in terms of fork(), those
restrictions should apply to it too.
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit 7704f5d into nix-rust:master Feb 21, 2021
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.

forkpty() should probably be unsafe
2 participants