1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 15:28:11 +00:00

Add uid and gid to CharacterDevices.

The vast majority of them will be owned by 0:0 (the default.)
However, PTY pairs will now be owned by the uid:gid of the opening process.
This commit is contained in:
Andreas Kling 2019-01-31 05:55:30 +01:00
parent c4fce9b3f9
commit 34e745b0b4
7 changed files with 32 additions and 5 deletions

View file

@ -1,6 +1,7 @@
#include "MasterPTY.h"
#include "SlavePTY.h"
#include "PTYMultiplexer.h"
#include <Kernel/Process.h>
#include <LibC/errno_numbers.h>
MasterPTY::MasterPTY(unsigned index)
@ -8,6 +9,8 @@ MasterPTY::MasterPTY(unsigned index)
, m_slave(adopt(*new SlavePTY(*this, index)))
, m_index(index)
{
set_uid(current->uid());
set_gid(current->gid());
}
MasterPTY::~MasterPTY()