mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Kernel: Ignore dirfd if absolute path is given in VFS-related syscalls
To be able to do this, we add a new class called CustodyBase, which can be resolved on-demand internally in the VirtualFileSystem resolving path code. When being resolved, CustodyBase will return a known custody if it was constructed with such, if that's not the case it will provide the root custody if the original path is absolute. Lastly, if that's not the case as well, it will resolve the given dirfd to provide a Custody object.
This commit is contained in:
@@ -1195,6 +1195,11 @@ RefPtr<Custody const> Process::executable() const
|
||||
return m_executable.with([](auto& executable) { return executable; });
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Custody>> Process::custody_for_dirfd(Badge<CustodyBase>, int dirfd)
|
||||
{
|
||||
return custody_for_dirfd(dirfd);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Custody>> Process::custody_for_dirfd(int dirfd)
|
||||
{
|
||||
if (dirfd == AT_FDCWD)
|
||||
|
||||
Reference in New Issue
Block a user