From 2d1f3ec749832822c00a9278161890918416e9be Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 13 Sep 2019 14:35:18 +0200 Subject: [PATCH] Kernel: fchdir() should fail for non-searchable directories So sayeth POSIX. --- Kernel/Process.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 4e92dbc4e3..ab6b87ff81 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1211,6 +1211,9 @@ int Process::sys$fchdir(int fd) if (!description->is_directory()) return -ENOTDIR; + if (!description->metadata().may_execute(*this)) + return -EACCES; + m_cwd = description->custody(); return 0; }