summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/File.h
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2020-05-28 17:32:20 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-29 07:53:30 +0200
commita9946a99f24e17644b2b7796ec8be10c8913f38b (patch)
tree99ea01a7690b0cccc86648e69c4a397a54fb1111 /Kernel/FileSystem/File.h
parent67cbc015d53df09b7ef4e70ee818e3f16e6c37dc (diff)
downloadserenity-a9946a99f24e17644b2b7796ec8be10c8913f38b.zip
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.
Diffstat (limited to 'Kernel/FileSystem/File.h')
-rw-r--r--Kernel/FileSystem/File.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/File.h b/Kernel/FileSystem/File.h
index 0ba1fb239f..02fc614326 100644
--- a/Kernel/FileSystem/File.h
+++ b/Kernel/FileSystem/File.h
@@ -82,8 +82,8 @@ public:
virtual String absolute_path(const FileDescription&) const = 0;
virtual KResult truncate(u64) { return KResult(-EINVAL); }
- virtual KResult chown(uid_t, gid_t) { return KResult(-EBADF); }
- virtual KResult chmod(mode_t) { return KResult(-EBADF); }
+ virtual KResult chown(FileDescription&, uid_t, gid_t) { return KResult(-EBADF); }
+ virtual KResult chmod(FileDescription&, mode_t) { return KResult(-EBADF); }
virtual const char* class_name() const = 0;