mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
Terminal+HackStudio: Fix leaking PTM fd to child processes
The pseudoterminal *master* fd is not supposed to be inherited, so make sure to open it with O_CLOEXEC.
This commit is contained in:
parent
bf012ca10a
commit
d3504b4f9b
Notes:
sideshowbarker
2024-07-19 11:14:28 +09:00
Author: https://github.com/bugaevc
Commit: d3504b4f9b
Pull-request: https://github.com/SerenityOS/serenity/pull/774
2 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ void TerminalWrapper::run_command(const String& command)
|
|||
return;
|
||||
}
|
||||
|
||||
int ptm_fd = open("/dev/ptmx", O_RDWR);
|
||||
int ptm_fd = open("/dev/ptmx", O_RDWR | O_CLOEXEC);
|
||||
if (ptm_fd < 0) {
|
||||
perror("open(ptmx)");
|
||||
ASSERT_NOT_REACHED();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue