summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-27 15:38:07 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-27 15:38:07 +0100
commitddaedbca8789eb17c900981d91da1afe9f46a10b (patch)
treee586f319066b4d1f1881aa2a5450a5ff3eab4051
parent3499ac4b54b56a3da0fee0a45f2fb28a74b6a075 (diff)
downloadserenity-ddaedbca8789eb17c900981d91da1afe9f46a10b.zip
Kernel: Allow sys$rename() to rename symlinks
Previously, this syscall would try to rename the target of the link, not the link itself.
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index aacd49f6a1..392aeba8c3 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/Kernel/FileSystem/VirtualFileSystem.cpp
@@ -503,7 +503,7 @@ KResult VFS::chmod(StringView path, mode_t mode, Custody& base)
KResult VFS::rename(StringView old_path, StringView new_path, Custody& base)
{
RefPtr<Custody> old_parent_custody;
- auto old_custody_or_error = resolve_path(old_path, base, &old_parent_custody);
+ auto old_custody_or_error = resolve_path(old_path, base, &old_parent_custody, O_NOFOLLOW_NOERROR);
if (old_custody_or_error.is_error())
return old_custody_or_error.error();
auto& old_custody = *old_custody_or_error.value();