From e81cf66784d119fc8e27372aa2d98f1bbc2c7feb Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 14 Oct 2022 22:19:14 +0300 Subject: [PATCH] Kernel: Don't assume paths to children PID directories in ProcFS code Instead of using absolute paths which is considered an abstraction layer violation between the kernel and userspace, let's not hardcode the path to children PID directories but instead we can use relative path links to them. --- Kernel/ProcessSpecificExposed.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/ProcessSpecificExposed.cpp b/Kernel/ProcessSpecificExposed.cpp index a714884e53..a0855478f3 100644 --- a/Kernel/ProcessSpecificExposed.cpp +++ b/Kernel/ProcessSpecificExposed.cpp @@ -112,7 +112,7 @@ ErrorOr> Process::lookup_children_directory(ProcFS cons ErrorOr Process::procfs_get_child_proccess_link(ProcessID child_pid, KBufferBuilder& builder) const { - TRY(builder.appendff("/proc/{}", child_pid.value())); + TRY(builder.appendff("../../{}", child_pid.value())); return builder.length(); }