Index: ipc/ipc_channel_posix.cc |
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc |
index 5ff25aa73a55476a8624c68edbbd7e29b46fa4f6..d4cf817bb0f59437841907817a1f9bfbbd5b5d94 100644 |
--- a/ipc/ipc_channel_posix.cc |
+++ b/ipc/ipc_channel_posix.cc |
@@ -167,14 +167,14 @@ bool CreateServerUnixDomainSocket(const std::string& pipe_name, |
// Delete any old FS instances. |
unlink(pipe_name.c_str()); |
- // Make sure the path we need exists. |
+ // Make sure the path we need exists. |
dmac
2011/01/19 23:54:37
thanks for catching the comments
|
FilePath path(pipe_name); |
FilePath dir_path = path.DirName(); |
if (!file_util::CreateDirectory(dir_path)) { |
return false; |
} |
- // Create unix_addr structure |
+ // Create unix_addr structure. |
struct sockaddr_un unix_addr; |
memset(&unix_addr, 0, sizeof(unix_addr)); |
unix_addr.sun_family = AF_UNIX; |
@@ -193,6 +193,9 @@ bool CreateServerUnixDomainSocket(const std::string& pipe_name, |
return false; |
} |
+ // Adjust the socket permissions. |
+ fchmod(fd, 0600); |
dmac
2011/01/19 23:54:37
can you check this for errors? and then PLOG as ap
dtu
2011/01/19 23:59:18
Done.
|
+ |
// Start listening on the socket. |
const int listen_queue_length = 1; |
if (listen(fd, listen_queue_length) != 0) { |