From ddd0b192819b3d782682a47e463dc30ee29c739e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 10 Jan 2020 23:14:04 +0100 Subject: Kernel: Add a basic chroot() syscall :^) The chroot() syscall now allows the superuser to isolate a process into a specific subtree of the filesystem. This is not strictly permanent, as it is also possible for a superuser to break *out* of a chroot, but it is a useful mechanism for isolating unprivileged processes. The VFS now uses the current process's root_directory() as the root for path resolution purposes. The root directory is stored as an uncached Custody in the Process object. --- Kernel/init.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Kernel/init.cpp') diff --git a/Kernel/init.cpp b/Kernel/init.cpp index b7df3d8691..8022facf29 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -145,6 +145,8 @@ VFS* vfs; hang(); } + current->process().set_root_directory(vfs->root_custody()); + dbgprintf("Load ksyms\n"); load_ksyms(); dbgprintf("Loaded ksyms\n"); -- cgit v1.2.3