summaryrefslogtreecommitdiff
path: root/src/event
diff options
context:
space:
mode:
author1848 <>2018-08-14 22:53:19 +0200
committer1848 <>2018-08-14 22:53:19 +0200
commit4797357fa9fe4cd9adfbbbf59288f38232ada262 (patch)
treed6398b782d8e3bc8cc9b9e0073643d5363d5ca93 /src/event
parentc46483a4ab2fe0f206473f4907ec35044d18c30a (diff)
fixed setting unix socket permissions
first call fchmod() to prevent TOCTTOU, then apply permissions using chmod()
Diffstat (limited to 'src/event')
-rw-r--r--src/event/ServerSocket.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx
index 4e00ac41b..67919b913 100644
--- a/src/event/ServerSocket.cxx
+++ b/src/event/ServerSocket.cxx
@@ -184,6 +184,13 @@ OneServerSocket::Open()
SOCK_STREAM, 0,
address, 5);
+#ifdef HAVE_UN
+ /* allow everybody to connect */
+
+ if (!path.IsNull())
+ chmod(path.c_str(), 0666);
+#endif
+
/* register in the EventLoop */
SetFD(_fd.Release());