mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 14:07:42 +00:00
Kernel: Move process "dumpable" flag into protected data
This commit is contained in:
parent
3d27269f13
commit
37ad880660
2 changed files with 10 additions and 4 deletions
|
@ -725,4 +725,11 @@ bool Process::add_thread(Thread& thread)
|
||||||
return is_first;
|
return is_first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Process::set_dumpable(bool dumpable)
|
||||||
|
{
|
||||||
|
if (dumpable == protected_data().dumpable)
|
||||||
|
return;
|
||||||
|
MutableProtectedData(*this)->dumpable = dumpable;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@ class Process
|
||||||
uid_t suid { 0 };
|
uid_t suid { 0 };
|
||||||
gid_t sgid { 0 };
|
gid_t sgid { 0 };
|
||||||
Vector<gid_t> extra_gids;
|
Vector<gid_t> extra_gids;
|
||||||
|
bool dumpable { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper class to temporarily unprotect a process's protected data so you can write to it.
|
// Helper class to temporarily unprotect a process's protected data so you can write to it.
|
||||||
|
@ -212,8 +213,8 @@ public:
|
||||||
gid_t sgid() const { return protected_data().sgid; }
|
gid_t sgid() const { return protected_data().sgid; }
|
||||||
ProcessID ppid() const { return protected_data().ppid; }
|
ProcessID ppid() const { return protected_data().ppid; }
|
||||||
|
|
||||||
bool is_dumpable() const { return m_dumpable; }
|
bool is_dumpable() const { return protected_data().dumpable; }
|
||||||
void set_dumpable(bool dumpable) { m_dumpable = dumpable; }
|
void set_dumpable(bool);
|
||||||
|
|
||||||
mode_t umask() const { return m_umask; }
|
mode_t umask() const { return m_umask; }
|
||||||
|
|
||||||
|
@ -590,8 +591,6 @@ private:
|
||||||
|
|
||||||
mode_t m_umask { 022 };
|
mode_t m_umask { 022 };
|
||||||
|
|
||||||
bool m_dumpable { true };
|
|
||||||
|
|
||||||
WeakPtr<Region> m_master_tls_region;
|
WeakPtr<Region> m_master_tls_region;
|
||||||
size_t m_master_tls_size { 0 };
|
size_t m_master_tls_size { 0 };
|
||||||
size_t m_master_tls_alignment { 0 };
|
size_t m_master_tls_alignment { 0 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue