1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:45:08 +00:00

MenuApplets: Use unveil()

The Clock and Audio applets really only need ("/res", "r") for LibGUI.

The CPUGraph applet also needs ("/proc/all", "r") for reading the CPU
usage data. Somewhat surprisingly, this also adds ("/etc/passwd", "r")
since CProcessStatisticsReader does username lookups.
This commit is contained in:
Andreas Kling 2020-01-21 15:47:34 +01:00
parent a2ed805d23
commit 5dd5d5ca4e
3 changed files with 34 additions and 0 deletions

View file

@ -96,6 +96,13 @@ int main(int argc, char** argv)
window->set_main_widget(widget);
window->show();
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
unveil(nullptr, nullptr);
if (pledge("stdio shared_buffer accept rpath", nullptr) < 0) {
perror("pledge");
return 1;