Chromium Code Reviews| 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 |