diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index 0ec583f6e6..7b1087c9ad 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -336,6 +336,10 @@ KResult VFS::rename(StringView old_path, StringView new_path, Inode& base) // FIXME: Is this really correct? Check what other systems do. if (new_inode == old_inode) return KSuccess; + if (new_parent_inode->metadata().is_sticky()) { + if (!current->process().is_superuser() && new_inode->metadata().uid != current->process().euid()) + return KResult(-EACCES); + } if (new_inode->is_directory() && !old_inode->is_directory()) return KResult(-EISDIR); auto result = new_parent_inode->remove_child(FileSystemPath(new_path).basename());