mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Require "tty" for ioctl() on TTY and MasterPTY
SystemServer now pledges "tty" since it's used when spawning services.
This commit is contained in:
parent
35c84504cd
commit
62a191b59a
Notes:
sideshowbarker
2024-07-19 10:08:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/62a191b59a8
3 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue