Use fchmod instead of chmod for unix sockets to prevent TOCTTOU
This commit is contained in:
parent
2127a482da
commit
84054203af
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user