Use fchmod instead of chmod for unix sockets to prevent TOCTTOU

This commit is contained in:
1848 2018-08-07 21:30:25 +02:00
parent 2127a482da
commit 84054203af

View File

@ -188,10 +188,10 @@ OneServerSocket::Open()
/* allow everybody to connect */
if (!path.IsNull())
chmod(path.c_str(), 0666);
fchmod(_fd.Get(), 0666);
#endif
/* register in the EventLoop */
/* register in the EventLoop */
SetFD(_fd.Release());
}