summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-08-20 08:36:58 +0300
committerAndreas Kling <kling@serenityos.org>2021-09-08 00:42:20 +0200
commita7cb2ca1bf26e25142a5076ad02e5ced31ca2fbc (patch)
tree7674124ad54746517d2ddd731b4af742fb9c083d /Userland/Services
parent3d5ddbab7488ccda86e19f4ddfab56e27c8ad033 (diff)
downloadserenity-a7cb2ca1bf26e25142a5076ad02e5ced31ca2fbc.zip
SystemServer: Don't rely on fstab to specify where to mount the ProcFS
For now, just hardcode the mounting in SystemServer code.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/SystemServer/main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Userland/Services/SystemServer/main.cpp b/Userland/Services/SystemServer/main.cpp
index ce07c900e2..4931a7677b 100644
--- a/Userland/Services/SystemServer/main.cpp
+++ b/Userland/Services/SystemServer/main.cpp
@@ -323,10 +323,15 @@ static void populate_devfs()
umask(old_mask);
}
-static void prepare_devfs()
+static void prepare_synthetic_filesystems()
{
// FIXME: Find a better way to all of this stuff, without hardcoding all of this!
- int rc = mount(-1, "/sys", "sys", 0);
+ int rc = mount(-1, "/proc", "proc", MS_NOSUID);
+ if (rc != 0) {
+ VERIFY_NOT_REACHED();
+ }
+
+ rc = mount(-1, "/sys", "sys", 0);
if (rc != 0) {
VERIFY_NOT_REACHED();
}
@@ -445,14 +450,14 @@ static void create_tmp_coredump_directory()
int main(int, char**)
{
- prepare_devfs();
+ mount_all_filesystems();
+ prepare_synthetic_filesystems();
if (pledge("stdio proc exec tty accept unix rpath wpath cpath chown fattr id sigaction", nullptr) < 0) {
perror("pledge");
return 1;
}
- mount_all_filesystems();
create_tmp_coredump_directory();
parse_boot_mode();