summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/TTY/MasterPTY.cpp1
-rw-r--r--Kernel/TTY/TTY.cpp1
-rw-r--r--Servers/SystemServer/main.cpp2
3 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp
index a7715a1678..428ee869ea 100644
--- a/Kernel/TTY/MasterPTY.cpp
+++ b/Kernel/TTY/MasterPTY.cpp
@@ -98,6 +98,7 @@ void MasterPTY::close()
int MasterPTY::ioctl(FileDescription& description, unsigned request, unsigned arg)
{
+ REQUIRE_PROMISE(tty);
if (!m_slave)
return -EIO;
if (request == TIOCSWINSZ || request == TIOCGPGRP)
diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp
index a85dfbeacd..feda853ed4 100644
--- a/Kernel/TTY/TTY.cpp
+++ b/Kernel/TTY/TTY.cpp
@@ -242,6 +242,7 @@ void TTY::set_termios(const termios& t)
int TTY::ioctl(FileDescription&, unsigned request, unsigned arg)
{
+ REQUIRE_PROMISE(tty);
auto& process = current->process();
pid_t pgid;
termios* tp;
diff --git a/Servers/SystemServer/main.cpp b/Servers/SystemServer/main.cpp
index a9599486bf..154334ee0c 100644
--- a/Servers/SystemServer/main.cpp
+++ b/Servers/SystemServer/main.cpp
@@ -77,7 +77,7 @@ static void mount_all_filesystems()
int main(int, char**)
{
- if (pledge("stdio proc exec unix rpath wpath cpath chown fattr id", nullptr) < 0) {
+ if (pledge("stdio proc exec tty unix rpath wpath cpath chown fattr id", nullptr) < 0) {
perror("pledge");
return 1;
}