mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
Kernel: Use Process::credentials() and remove user ID/group ID helpers
Move away from using the group ID/user ID helpers in the process to allow for us to take advantage of the immutable credentials instead.
This commit is contained in:
committed by
Andreas Kling
parent
8026d8926c
commit
f86b671de2
@@ -522,10 +522,11 @@ Time kgettimeofday()
|
||||
|
||||
siginfo_t Process::wait_info() const
|
||||
{
|
||||
auto credentials = this->credentials();
|
||||
siginfo_t siginfo {};
|
||||
siginfo.si_signo = SIGCHLD;
|
||||
siginfo.si_pid = pid().value();
|
||||
siginfo.si_uid = uid().value();
|
||||
siginfo.si_uid = credentials->uid().value();
|
||||
|
||||
with_protected_data([&](auto& protected_data) {
|
||||
if (protected_data.termination_signal != 0) {
|
||||
@@ -941,36 +942,6 @@ ErrorOr<void> Process::require_promise(Pledge promise)
|
||||
return EPROMISEVIOLATION;
|
||||
}
|
||||
|
||||
UserID Process::uid() const
|
||||
{
|
||||
return credentials()->uid();
|
||||
}
|
||||
|
||||
GroupID Process::gid() const
|
||||
{
|
||||
return credentials()->gid();
|
||||
}
|
||||
|
||||
UserID Process::euid() const
|
||||
{
|
||||
return credentials()->euid();
|
||||
}
|
||||
|
||||
GroupID Process::egid() const
|
||||
{
|
||||
return credentials()->egid();
|
||||
}
|
||||
|
||||
UserID Process::suid() const
|
||||
{
|
||||
return credentials()->suid();
|
||||
}
|
||||
|
||||
GroupID Process::sgid() const
|
||||
{
|
||||
return credentials()->sgid();
|
||||
}
|
||||
|
||||
NonnullRefPtr<Credentials> Process::credentials() const
|
||||
{
|
||||
return with_protected_data([&](auto& protected_data) -> NonnullRefPtr<Credentials> {
|
||||
|
||||
Reference in New Issue
Block a user