From eb9ccf1c0a6fa184ee3c179f2e53170acbf36d7c Mon Sep 17 00:00:00 2001 From: Rok Povsic Date: Sun, 25 Aug 2019 18:18:51 +0200 Subject: [PATCH] FileSystem: Add FIXME about resolve_path bug --- Kernel/FileSystem/VirtualFileSystem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index 459753221c..5e63245f4f 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -637,6 +637,9 @@ Custody& VFS::root_custody() KResultOr> VFS::resolve_path(StringView path, Custody& base, RefPtr* parent_custody, int options) { + // FIXME: resolve_path currently doesn't deal with .. and . . If path is ../. and base is /home/anon, it returns + // /home/anon/../. instead of /home . + if (path.is_empty()) return KResult(-EINVAL);