diff options
author | 1848 <> | 2018-08-07 21:30:25 +0200 |
---|---|---|
committer | 1848 <> | 2018-08-07 21:30:25 +0200 |
commit | 84054203afeb9f3c0ece9b85922bb357f9419d14 (patch) | |
tree | 3c6f594d0e82d4cdd3a7fc22484d7d283d0feda3 /src/event/ServerSocket.cxx | |
parent | 2127a482da8531980bb7e931a507505532f92c65 (diff) |
Use fchmod instead of chmod for unix sockets to prevent TOCTTOU
Diffstat (limited to 'src/event/ServerSocket.cxx')
-rw-r--r-- | src/event/ServerSocket.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index f9ec3104b..12576d2a2 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -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()); } |