Ver código fonte

SystemMonitor: Use unveil()

Andreas Kling 5 anos atrás
pai
commit
edf509c19e
1 arquivos alterados com 17 adições e 0 exclusões
  1. 17 0
      Applications/SystemMonitor/main.cpp

+ 17 - 0
Applications/SystemMonitor/main.cpp

@@ -88,6 +88,23 @@ int main(int argc, char** argv)
         return 1;
     }
 
+    if (unveil("/etc/passwd", "r") < 0) {
+        perror("unveil");
+        return 1;
+    }
+
+    if (unveil("/res", "r") < 0) {
+        perror("unveil");
+        return 1;
+    }
+
+    if (unveil("/proc", "r") < 0) {
+        perror("unveil");
+        return 1;
+    }
+
+    unveil(nullptr, nullptr);
+
     auto keeper = GWidget::construct();
     keeper->set_layout(make<GBoxLayout>(Orientation::Vertical));
     keeper->set_fill_with_background_color(true);