Inspector: Throw an error when inspecting a process it has no access to

This commit is contained in:
Anand 2021-05-20 11:11:20 +05:30 committed by Andreas Kling
parent e95eb7a51d
commit 4a2dd5bf66
Notes: sideshowbarker 2024-07-18 17:43:40 +09:00

View File

@ -97,6 +97,11 @@ int main(int argc, char** argv)
return 1;
}
if (access(String::formatted("/proc/{}", pid).characters(), R_OK) == -1) {
GUI::MessageBox::show(window, "Inspector doesn't have permission to access the process.", "Error", GUI::MessageBox::Type::Error);
return 1;
}
window->set_title("Inspector");
window->resize(685, 500);
window->set_icon(app_icon.bitmap_for_size(16));