| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #include <dirent.h> | 7 #include <dirent.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <fnmatch.h> | 10 #include <fnmatch.h> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 #if !defined(OS_IOS) | 53 #if !defined(OS_IOS) |
| 54 #include <grp.h> | 54 #include <grp.h> |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 namespace file_util { | 57 namespace file_util { |
| 58 | 58 |
| 59 namespace { | 59 namespace { |
| 60 | 60 |
| 61 #if defined(OS_BSD) || defined(OS_IOS) || (defined(OS_MACOSX) && \ | 61 #if defined(OS_BSD) || defined(OS_MACOSX) |
| 62 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) | |
| 63 typedef struct stat stat_wrapper_t; | 62 typedef struct stat stat_wrapper_t; |
| 64 static int CallStat(const char *path, stat_wrapper_t *sb) { | 63 static int CallStat(const char *path, stat_wrapper_t *sb) { |
| 65 base::ThreadRestrictions::AssertIOAllowed(); | 64 base::ThreadRestrictions::AssertIOAllowed(); |
| 66 return stat(path, sb); | 65 return stat(path, sb); |
| 67 } | 66 } |
| 68 static int CallLstat(const char *path, stat_wrapper_t *sb) { | 67 static int CallLstat(const char *path, stat_wrapper_t *sb) { |
| 69 base::ThreadRestrictions::AssertIOAllowed(); | 68 base::ThreadRestrictions::AssertIOAllowed(); |
| 70 return lstat(path, sb); | 69 return lstat(path, sb); |
| 71 } | 70 } |
| 72 #else | 71 #else |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 | 1151 |
| 1153 allowed_group_ids.insert(group_record->gr_gid); | 1152 allowed_group_ids.insert(group_record->gr_gid); |
| 1154 } | 1153 } |
| 1155 | 1154 |
| 1156 return VerifyPathControlledByUser( | 1155 return VerifyPathControlledByUser( |
| 1157 kFileSystemRoot, path, kRootUid, allowed_group_ids); | 1156 kFileSystemRoot, path, kRootUid, allowed_group_ids); |
| 1158 } | 1157 } |
| 1159 #endif // defined(OS_MACOSX) | 1158 #endif // defined(OS_MACOSX) |
| 1160 | 1159 |
| 1161 } // namespace file_util | 1160 } // namespace file_util |
| OLD | NEW |