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

Unified Diff: chrome/common/mac/app_mode_common.mm

Issue 66043003: Put app shim IPC socket in a temporary directory. (Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put App Shim Socket in "/tmp/chrome-<hash of UDD>/", make a symlink to it at "<UDD>/App Shim Socket… Created 6 years, 12 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
Index: chrome/common/mac/app_mode_common.mm
diff --git a/chrome/common/mac/app_mode_common.mm b/chrome/common/mac/app_mode_common.mm
index 317dec3b6331e32aa8ae332f02d4c4d9b74708f8..ad8223c79740bfec4f055fc930cdfa14a59ddf89 100644
--- a/chrome/common/mac/app_mode_common.mm
+++ b/chrome/common/mac/app_mode_common.mm
@@ -4,6 +4,8 @@
#include "chrome/common/mac/app_mode_common.h"
+#include "base/file_util.h"
+
namespace app_mode {
const char kAppShimSocketName[] = "App Shim Socket";
@@ -40,4 +42,19 @@ ChromeAppModeInfo::ChromeAppModeInfo()
ChromeAppModeInfo::~ChromeAppModeInfo() {
}
+void VerifySocketPermissions(const base::FilePath& socket_path) {
+ CHECK(base::PathIsWritable(socket_path));
+ int socket_mode = 0;
+ CHECK(base::GetPosixFilePermissions(socket_path, &socket_mode));
+ int socket_permissions =
+ base::FILE_PERMISSION_MASK &
+ ~(base::FILE_PERMISSION_WRITE_BY_GROUP) &
+ ~(base::FILE_PERMISSION_WRITE_BY_OTHERS);
tapted 2014/01/03 13:06:54 ugh - why does this enum exist.. The comment says
jackhou1 2014/01/06 05:29:52 Done. Also you're right, the sockets permissions
tapted 2014/01/06 07:31:28 I don't think we need to set the socket inode perm
+ CHECK_EQ(socket_permissions, socket_mode);
+ base::FilePath socket_dir = socket_path.DirName();
+ int socket_dir_mode = 0;
+ CHECK(base::GetPosixFilePermissions(socket_dir, &socket_dir_mode));
+ CHECK_EQ(base::FILE_PERMISSION_USER_MASK, socket_dir_mode);
+}
+
} // namespace app_mode
« apps/app_shim/chrome_main_app_mode_mac.mm ('K') | « chrome/common/mac/app_mode_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698