Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: ipc/ipc_channel_posix.cc

Issue 6280009: Adjust Unix domain IPC permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698