summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index 5539032e69..377bb14e93 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/Kernel/FileSystem/VirtualFileSystem.cpp
@@ -396,6 +396,9 @@ KResult VFS::rename(StringView old_path, StringView new_path, Custody& base)
auto& old_parent_inode = old_parent_custody->inode();
auto& new_parent_inode = new_parent_custody->inode();
+ if (&old_parent_inode.fs() != &new_parent_inode.fs())
+ return KResult(-EXDEV);
+
if (!new_parent_inode.metadata().may_write(current->process()))
return KResult(-EACCES);