Chromium Code Reviews| Index: ipc/ipc_channel_posix.cc |
| diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc |
| index 07d205a9b969d651f2c47a116b3cdb4ee5a02e62..0d48d47495764c6fb69d61008233290e685fafb1 100644 |
| --- a/ipc/ipc_channel_posix.cc |
| +++ b/ipc/ipc_channel_posix.cc |
| @@ -193,9 +193,13 @@ bool CreateServerUnixDomainSocket(const std::string& pipe_name, |
| return false; |
| } |
| - // Adjust the socket permissions. |
| + // Adjust the socket permissions as a precaution on ChromeOS. |
|
Wez
2011/02/25 10:23:14
Nit: We're adjusting the permissions even on Linux
|
| + // Do not rely on these file permissions to provide security - the file is |
| + // created during the above bind() call so there is still a window for |
| + // malicious abuse because the file exists between bind() and chmod(). Also, |
| + // the file permissions may not be enforced for unix sockets on all platforms. |
| if (chmod(pipe_name.c_str(), 0600)) { |
| - PLOG(ERROR) << "fchmod " << pipe_name; |
| + PLOG(ERROR) << "chmod " << pipe_name; |
| if (HANDLE_EINTR(close(fd)) < 0) |
| PLOG(ERROR) << "close " << pipe_name; |
| return false; |