From 8a295299f353f9490cbef1b23a2a3a9c8b4d776f Mon Sep 17 00:00:00 2001 From: Max Wipfli Date: Mon, 5 Jul 2021 19:08:31 +0200 Subject: [PATCH] Kernel: Fix regression in VFS::symlink The create_child method should be called with basename, not the full linkpath. --- Kernel/FileSystem/VirtualFileSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index dcf8abe19a..68894047bf 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -713,8 +713,8 @@ KResult VFS::symlink(StringView target, StringView linkpath, Custody& base) return EROFS; auto basename = LexicalPath::basename(linkpath); - dbgln_if(VFS_DEBUG, "VFS::symlink: '{}' (-> '{}') in {}", linkpath, target, parent_inode.identifier()); - auto inode_or_error = parent_inode.create_child(linkpath, S_IFLNK | 0644, 0, current_process->euid(), current_process->egid()); + dbgln_if(VFS_DEBUG, "VFS::symlink: '{}' (-> '{}') in {}", basename, target, parent_inode.identifier()); + auto inode_or_error = parent_inode.create_child(basename, S_IFLNK | 0644, 0, current_process->euid(), current_process->egid()); if (inode_or_error.is_error()) return inode_or_error.error(); auto& inode = inode_or_error.value();