mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-14 03:36:28 +00:00
Kernel: Strongly typed user & group ID's
Prior to this change, both uid_t and gid_t were typedef'ed to `u32`. This made it easy to use them interchangeably. Let's not allow that. This patch adds UserID and GroupID using the AK::DistinctNumeric mechanism we've already been employing for pid_t/ProcessID.
This commit is contained in:
@@ -35,7 +35,7 @@ Socket::Socket(int domain, int type, int protocol)
|
||||
, m_protocol(protocol)
|
||||
{
|
||||
auto& process = Process::current();
|
||||
m_origin = { process.pid().value(), process.uid(), process.gid() };
|
||||
m_origin = { process.pid().value(), process.uid().value(), process.gid().value() };
|
||||
}
|
||||
|
||||
Socket::~Socket()
|
||||
@@ -58,7 +58,7 @@ RefPtr<Socket> Socket::accept()
|
||||
auto client = m_pending.take_first();
|
||||
VERIFY(!client->is_connected());
|
||||
auto& process = Process::current();
|
||||
client->m_acceptor = { process.pid().value(), process.uid(), process.gid() };
|
||||
client->m_acceptor = { process.pid().value(), process.uid().value(), process.gid().value() };
|
||||
client->m_connected = true;
|
||||
client->m_role = Role::Accepted;
|
||||
if (!m_pending.is_empty())
|
||||
|
||||
Reference in New Issue
Block a user