Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/mac/app_mode_common.h" | 5 #include "chrome/common/mac/app_mode_common.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | |
| 8 | |
| 7 namespace app_mode { | 9 namespace app_mode { |
| 8 | 10 |
| 9 const char kAppShimSocketName[] = "App Shim Socket"; | 11 const char kAppShimSocketName[] = "App Shim Socket"; |
| 10 | 12 |
| 11 const char kAppListModeId[] = "app_list"; | 13 const char kAppListModeId[] = "app_list"; |
| 12 | 14 |
| 13 const char kLaunchedByChromeProcessId[] = "launched-by-chrome-process-id"; | 15 const char kLaunchedByChromeProcessId[] = "launched-by-chrome-process-id"; |
| 14 | 16 |
| 15 NSString* const kCFBundleDisplayNameKey = @"CFBundleDisplayName"; | 17 NSString* const kCFBundleDisplayNameKey = @"CFBundleDisplayName"; |
| 16 NSString* const kLSHasLocalizedDisplayNameKey = @"LSHasLocalizedDisplayName"; | 18 NSString* const kLSHasLocalizedDisplayNameKey = @"LSHasLocalizedDisplayName"; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 33 ChromeAppModeInfo::ChromeAppModeInfo() | 35 ChromeAppModeInfo::ChromeAppModeInfo() |
| 34 : major_version(0), | 36 : major_version(0), |
| 35 minor_version(0), | 37 minor_version(0), |
| 36 argc(0), | 38 argc(0), |
| 37 argv(0) { | 39 argv(0) { |
| 38 } | 40 } |
| 39 | 41 |
| 40 ChromeAppModeInfo::~ChromeAppModeInfo() { | 42 ChromeAppModeInfo::~ChromeAppModeInfo() { |
| 41 } | 43 } |
| 42 | 44 |
| 45 void VerifySocketPermissions(const base::FilePath& socket_path) { | |
| 46 CHECK(base::PathIsWritable(socket_path)); | |
| 47 int socket_mode = 0; | |
| 48 CHECK(base::GetPosixFilePermissions(socket_path, &socket_mode)); | |
| 49 int socket_permissions = | |
| 50 base::FILE_PERMISSION_MASK & | |
| 51 ~(base::FILE_PERMISSION_WRITE_BY_GROUP) & | |
| 52 ~(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
| |
| 53 CHECK_EQ(socket_permissions, socket_mode); | |
| 54 base::FilePath socket_dir = socket_path.DirName(); | |
| 55 int socket_dir_mode = 0; | |
| 56 CHECK(base::GetPosixFilePermissions(socket_dir, &socket_dir_mode)); | |
| 57 CHECK_EQ(base::FILE_PERMISSION_USER_MASK, socket_dir_mode); | |
| 58 } | |
| 59 | |
| 43 } // namespace app_mode | 60 } // namespace app_mode |
| OLD | NEW |