mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-24 15:13:57 +00:00
Kernel: Emit ProcFS pledge/veil properties as "N/A" for kernel processes
Pledges and Veil state don't really make sense for kernel mode processes, as they can do what ever they want since they are in kernel mode. Make this clear in the system monitor UI by marking these entries as null.
This commit is contained in:
parent
6fa76ed2e3
commit
c44d2515b4
Notes:
sideshowbarker
2024-07-19 03:30:08 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/c44d2515b4c Pull-request: https://github.com/SerenityOS/serenity/pull/3170
1 changed files with 19 additions and 13 deletions
|
@ -824,26 +824,32 @@ static Optional<KBuffer> procfs$all(InodeIdentifier)
|
|||
auto build_process = [&](const Process& process) {
|
||||
auto process_object = array.add_object();
|
||||
|
||||
StringBuilder pledge_builder;
|
||||
if (process.is_ring3()) {
|
||||
StringBuilder pledge_builder;
|
||||
|
||||
#define __ENUMERATE_PLEDGE_PROMISE(promise) \
|
||||
if (process.has_promised(Pledge::promise)) { \
|
||||
pledge_builder.append(#promise " "); \
|
||||
}
|
||||
ENUMERATE_PLEDGE_PROMISES
|
||||
ENUMERATE_PLEDGE_PROMISES
|
||||
#undef __ENUMERATE_PLEDGE_PROMISE
|
||||
|
||||
process_object.add("pledge", pledge_builder.to_string());
|
||||
process_object.add("pledge", pledge_builder.to_string());
|
||||
|
||||
switch (process.veil_state()) {
|
||||
case VeilState::None:
|
||||
process_object.add("veil", "None");
|
||||
break;
|
||||
case VeilState::Dropped:
|
||||
process_object.add("veil", "Dropped");
|
||||
break;
|
||||
case VeilState::Locked:
|
||||
process_object.add("veil", "Locked");
|
||||
break;
|
||||
switch (process.veil_state()) {
|
||||
case VeilState::None:
|
||||
process_object.add("veil", "None");
|
||||
break;
|
||||
case VeilState::Dropped:
|
||||
process_object.add("veil", "Dropped");
|
||||
break;
|
||||
case VeilState::Locked:
|
||||
process_object.add("veil", "Locked");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
process_object.add("pledge", String());
|
||||
process_object.add("veil", String());
|
||||
}
|
||||
|
||||
process_object.add("pid", process.pid().value());
|
||||
|
|
Loading…
Reference in a new issue