summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/VirtualFileSystem.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-28 22:11:16 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-29 01:09:19 +0200
commitae197deb6b076fb7b49bb035cfb3e4f8304004cb (patch)
treeb8c17f95b575be4453626c983c59e0a1c59a3658 /Kernel/FileSystem/VirtualFileSystem.h
parent59335bd8eaf7c4f11bb5a9ab96373dfe8eca0893 (diff)
downloadserenity-ae197deb6b076fb7b49bb035cfb3e4f8304004cb.zip
Kernel: Strongly typed user & group ID's
Prior to this change, both uid_t and gid_t were typedef'ed to `u32`. This made it easy to use them interchangeably. Let's not allow that. This patch adds UserID and GroupID using the AK::DistinctNumeric mechanism we've already been employing for pid_t/ProcessID.
Diffstat (limited to 'Kernel/FileSystem/VirtualFileSystem.h')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.h b/Kernel/FileSystem/VirtualFileSystem.h
index 9218b50146..d4695174fa 100644
--- a/Kernel/FileSystem/VirtualFileSystem.h
+++ b/Kernel/FileSystem/VirtualFileSystem.h
@@ -29,8 +29,8 @@ namespace Kernel {
#define O_UNLINK_INTERNAL (1 << 30)
struct UidAndGid {
- uid_t uid;
- gid_t gid;
+ UserID uid;
+ GroupID gid;
};
class VirtualFileSystem {
@@ -57,8 +57,8 @@ public:
KResult rmdir(StringView path, Custody& base);
KResult chmod(StringView path, mode_t, Custody& base);
KResult chmod(Custody&, mode_t);
- KResult chown(StringView path, uid_t, gid_t, Custody& base);
- KResult chown(Custody&, uid_t, gid_t);
+ KResult chown(StringView path, UserID, GroupID, Custody& base);
+ KResult chown(Custody&, UserID, GroupID);
KResult access(StringView path, int mode, Custody& base);
KResultOr<InodeMetadata> lookup_metadata(StringView path, Custody& base, int options = 0);
KResult utime(StringView path, Custody& base, time_t atime, time_t mtime);