diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-28 22:11:16 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-29 01:09:19 +0200 |
commit | ae197deb6b076fb7b49bb035cfb3e4f8304004cb (patch) | |
tree | b8c17f95b575be4453626c983c59e0a1c59a3658 /Kernel/FileSystem/Ext2FileSystem.h | |
parent | 59335bd8eaf7c4f11bb5a9ab96373dfe8eca0893 (diff) | |
download | serenity-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/Ext2FileSystem.h')
-rw-r--r-- | Kernel/FileSystem/Ext2FileSystem.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/FileSystem/Ext2FileSystem.h b/Kernel/FileSystem/Ext2FileSystem.h index 8ef16a05f2..e116fbbc94 100644 --- a/Kernel/FileSystem/Ext2FileSystem.h +++ b/Kernel/FileSystem/Ext2FileSystem.h @@ -44,7 +44,7 @@ private: virtual KResultOr<NonnullRefPtr<Inode>> lookup(StringView name) override; virtual void flush_metadata() override; virtual KResultOr<size_t> write_bytes(off_t, size_t, const UserOrKernelBuffer& data, FileDescription*) override; - virtual KResultOr<NonnullRefPtr<Inode>> create_child(StringView name, mode_t, dev_t, uid_t, gid_t) override; + virtual KResultOr<NonnullRefPtr<Inode>> create_child(StringView name, mode_t, dev_t, UserID, GroupID) override; virtual KResult add_child(Inode& child, const StringView& name, mode_t) override; virtual KResult remove_child(const StringView& name) override; virtual KResult set_atime(time_t) override; @@ -53,7 +53,7 @@ private: virtual KResult increment_link_count() override; virtual KResult decrement_link_count() override; virtual KResult chmod(mode_t) override; - virtual KResult chown(uid_t, gid_t) override; + virtual KResult chown(UserID, GroupID) override; virtual KResult truncate(u64) override; virtual KResultOr<int> get_block_address(int) override; @@ -130,8 +130,8 @@ private: virtual StringView class_name() const override { return "Ext2FS"sv; } virtual Ext2FSInode& root_inode() override; RefPtr<Inode> get_inode(InodeIdentifier) const; - KResultOr<NonnullRefPtr<Inode>> create_inode(Ext2FSInode& parent_inode, const String& name, mode_t, dev_t, uid_t, gid_t); - KResult create_directory(Ext2FSInode& parent_inode, const String& name, mode_t, uid_t, gid_t); + KResultOr<NonnullRefPtr<Inode>> create_inode(Ext2FSInode& parent_inode, const String& name, mode_t, dev_t, UserID, GroupID); + KResult create_directory(Ext2FSInode& parent_inode, const String& name, mode_t, UserID, GroupID); virtual void flush_writes() override; BlockIndex first_block_index() const; |