Kernel: unlink() should not follow symlinks

This commit is contained in:
Andreas Kling 2020-01-10 12:51:05 +01:00
parent f026f0f4bb
commit b1ffde6199
Notes: sideshowbarker 2024-07-19 10:13:54 +09:00
2 changed files with 16 additions and 1 deletions

View file

@ -518,7 +518,7 @@ KResult VFS::link(StringView old_path, StringView new_path, Custody& base)
KResult VFS::unlink(StringView path, Custody& base)
{
RefPtr<Custody> parent_custody;
auto custody_or_error = resolve_path(path, base, &parent_custody);
auto custody_or_error = resolve_path(path, base, &parent_custody, O_NOFOLLOW_NOERROR);
if (custody_or_error.is_error())
return custody_or_error.error();
auto& custody = *custody_or_error.value();