1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 01:27:42 +00:00

Kernel: Add helper function to check if a Process is in jail

Use this helper function in various places to replace the old code of
acquiring the SpinlockProtected<RefPtr<Jail>> of a Process to do that
validation.
This commit is contained in:
Liav A 2023-01-06 09:13:40 +02:00 committed by Linus Groh
parent 6b3688147f
commit d8ebcaede8
4 changed files with 15 additions and 18 deletions

View file

@ -240,6 +240,11 @@ public:
SpinlockProtected<RefPtr<Jail>, LockRank::Process>& jail() { return m_attached_jail; }
bool is_currently_in_jail() const
{
return m_attached_jail.with([&](auto& jail) -> bool { return !jail.is_null(); });
}
NonnullRefPtr<Credentials> credentials() const;
bool is_dumpable() const