mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
Kernel: Trying to sys$link() a directory should fail with EPERM
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 10:02:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d4d17ce4235
@@ -521,6 +521,9 @@ KResult VFS::link(StringView old_path, StringView new_path, Custody& base)
|
||||
if (!parent_inode.metadata().may_write(current->process()))
|
||||
return KResult(-EACCES);
|
||||
|
||||
if (old_inode.is_directory())
|
||||
return KResult(-EPERM);
|
||||
|
||||
return parent_inode.add_child(old_inode.identifier(), FileSystemPath(new_path).basename(), old_inode.mode());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user