mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
Kernel: Pass a FileDescription to File::chmod() and File::chown()
We're going to make use of it in the next commit. But the idea is we want to know how this File (more specifically, InodeFile) was opened in order to decide how chown()/chmod() should behave, in particular whether it should be allowed or not. Note that many other File operations, such as read(), write(), and ioctl(), already require the caller to pass a FileDescription.
This commit is contained in:
committed by
Andreas Kling
parent
67cbc015d5
commit
a9946a99f2
@@ -330,13 +330,13 @@ void FileDescription::set_file_flags(u32 flags)
|
||||
KResult FileDescription::chmod(mode_t mode)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
return m_file->chmod(mode);
|
||||
return m_file->chmod(*this, mode);
|
||||
}
|
||||
|
||||
KResult FileDescription::chown(uid_t uid, gid_t gid)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
return m_file->chown(uid, gid);
|
||||
return m_file->chown(*this, uid, gid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user