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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 6585001: Expand comment for named IPC chmod(). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: wez Created 9 years, 10 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 07d205a9b969d651f2c47a116b3cdb4ee5a02e62..4135a050e2412640f5be31743aaab3d5d982ab36 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -193,9 +193,14 @@ bool CreateServerUnixDomainSocket(const std::string& pipe_name,
return false;
}
- // Adjust the socket permissions.
+ // Explicitly set file system permissions on socket, mainly as a precaution
+ // for Chrome OS.
+ // 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;
« 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