mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
Kernel: Move m_uid and m_gid from the Device class to SlavePTY
No other device needs to store the UID/GID of the process that created them, so only store these values within the SlavePTY class.
This commit is contained in:
parent
8d81b08f6d
commit
ed315dd950
5 changed files with 16 additions and 23 deletions
|
@ -35,17 +35,14 @@ bool SlavePTY::unref() const
|
|||
return did_hit_zero;
|
||||
}
|
||||
|
||||
SlavePTY::SlavePTY(NonnullRefPtr<MasterPTY> master, unsigned index)
|
||||
SlavePTY::SlavePTY(NonnullRefPtr<MasterPTY> master, UserID uid, GroupID gid, unsigned index)
|
||||
: TTY(201, index)
|
||||
, m_master(move(master))
|
||||
, m_index(index)
|
||||
, m_uid(uid)
|
||||
, m_gid(gid)
|
||||
{
|
||||
auto& process = Process::current();
|
||||
auto credentials = process.credentials();
|
||||
set_uid(credentials->uid());
|
||||
set_gid(credentials->gid());
|
||||
set_size(80, 25);
|
||||
|
||||
SlavePTY::all_instances().with([&](auto& list) { list.append(*this); });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue