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/Net/LocalSocket.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/Net/LocalSocket.h')
-rw-r--r-- | Kernel/Net/LocalSocket.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/LocalSocket.h b/Kernel/Net/LocalSocket.h index 1c249cfcd9..af4728c53f 100644 --- a/Kernel/Net/LocalSocket.h +++ b/Kernel/Net/LocalSocket.h @@ -48,7 +48,7 @@ public: virtual KResultOr<size_t> recvfrom(FileDescription&, UserOrKernelBuffer&, size_t, int flags, Userspace<sockaddr*>, Userspace<socklen_t*>, Time&) override; virtual KResult getsockopt(FileDescription&, int level, int option, Userspace<void*>, Userspace<socklen_t*>) override; virtual KResult ioctl(FileDescription&, unsigned request, Userspace<void*> arg) override; - virtual KResult chown(FileDescription&, uid_t, gid_t) override; + virtual KResult chown(FileDescription&, UserID, GroupID) override; virtual KResult chmod(FileDescription&, mode_t) override; private: @@ -72,8 +72,8 @@ private: // An open socket file on the filesystem. RefPtr<FileDescription> m_file; - uid_t m_prebind_uid { 0 }; - gid_t m_prebind_gid { 0 }; + UserID m_prebind_uid { 0 }; + GroupID m_prebind_gid { 0 }; mode_t m_prebind_mode { 0 }; // A single LocalSocket is shared between two file descriptions |