summaryrefslogtreecommitdiff
path: root/Kernel/Net/LocalSocket.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-21 13:14:26 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-21 13:27:08 +0100
commit6081c7651582065c36d5316ae526140b2a4adc46 (patch)
treeccd294776b578004a339dac44ed2ac8310b87de3 /Kernel/Net/LocalSocket.cpp
parentefbd1620d9b3b74243b11fc3d6d9cab6b9f93174 (diff)
downloadserenity-6081c7651582065c36d5316ae526140b2a4adc46.zip
Kernel: Make O_RDONLY non-zero
Sergey suggested that having a non-zero O_RDONLY would make some things less confusing, and it seems like he's right about that. We can now easily check read/write permissions separately instead of dancing around with the bits. This patch also fixes unveil() validation for O_RDWR which previously forgot to check for "r" permission.
Diffstat (limited to 'Kernel/Net/LocalSocket.cpp')
-rw-r--r--Kernel/Net/LocalSocket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/LocalSocket.cpp b/Kernel/Net/LocalSocket.cpp
index 12269b83fa..0c59ba14f8 100644
--- a/Kernel/Net/LocalSocket.cpp
+++ b/Kernel/Net/LocalSocket.cpp
@@ -111,7 +111,7 @@ KResult LocalSocket::bind(const sockaddr* user_address, socklen_t address_size)
mode_t mode = S_IFSOCK | (m_prebind_mode & 04777);
UidAndGid owner { m_prebind_uid, m_prebind_gid };
- auto result = VFS::the().open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW_NOERROR, mode, current->process().current_directory(), owner);
+ auto result = VFS::the().open(path, O_CREAT | O_EXCL | O_NOFOLLOW_NOERROR, mode, current->process().current_directory(), owner);
if (result.is_error()) {
if (result.error() == -EEXIST)
return KResult(-EADDRINUSE);