-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.1.1 Do not leak file descriptors (#35)
The `openpty` function was created on a simpler time, when `O_CLOEXEC` was not even a thing. Leaking file descriptors was _fine_. But we don't live in that world anymore. This change now marks both ends of the PTY as close-on-exec, so that the file descriptors are not leaked. Importantly, since we rely on both copies (the one in ruspty and the one in the child) being closed to consider the stream done, _if_ we manage to leak the FD to another shell, there will be an unexpected third copy, so the stream will unnecessarily hang for a second (good that we added a failsafe cap on execution time)!
- Loading branch information
Showing
5 changed files
with
114 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@replit/ruspty", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"main": "dist/wrapper.js", | ||
"types": "dist/wrapper.d.ts", | ||
"author": "Szymon Kaliski <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters