浏览代码

SystemMonitor: Use unveil()

Andreas Kling 5 年之前
父节点
当前提交
edf509c19e
共有 1 个文件被更改,包括 17 次插入0 次删除
  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);