| 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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 memcpy(&(info->stat), &(cur_entry->stat), sizeof(info->stat)); | 823 memcpy(&(info->stat), &(cur_entry->stat), sizeof(info->stat)); |
| 824 info->filename.assign(cur_entry->filename.value()); | 824 info->filename.assign(cur_entry->filename.value()); |
| 825 } | 825 } |
| 826 | 826 |
| 827 // static | 827 // static |
| 828 bool FileEnumerator::IsDirectory(const FindInfo& info) { | 828 bool FileEnumerator::IsDirectory(const FindInfo& info) { |
| 829 return S_ISDIR(info.stat.st_mode); | 829 return S_ISDIR(info.stat.st_mode); |
| 830 } | 830 } |
| 831 | 831 |
| 832 // static | 832 // static |
| 833 bool FileEnumerator::IsLink(const FindInfo& info) { | |
| 834 return S_ISLNK(info.stat.st_mode); | |
| 835 } | |
| 836 | |
| 837 // static | |
| 838 FilePath FileEnumerator::GetFilename(const FindInfo& find_info) { | 833 FilePath FileEnumerator::GetFilename(const FindInfo& find_info) { |
| 839 return FilePath(find_info.filename); | 834 return FilePath(find_info.filename); |
| 840 } | 835 } |
| 841 | 836 |
| 842 // static | 837 // static |
| 843 int64 FileEnumerator::GetFilesize(const FindInfo& find_info) { | 838 int64 FileEnumerator::GetFilesize(const FindInfo& find_info) { |
| 844 return find_info.stat.st_size; | 839 return find_info.stat.st_size; |
| 845 } | 840 } |
| 846 | 841 |
| 847 // static | 842 // static |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 | 1152 |
| 1158 allowed_group_ids.insert(group_record->gr_gid); | 1153 allowed_group_ids.insert(group_record->gr_gid); |
| 1159 } | 1154 } |
| 1160 | 1155 |
| 1161 return VerifyPathControlledByUser( | 1156 return VerifyPathControlledByUser( |
| 1162 kFileSystemRoot, path, kRootUid, allowed_group_ids); | 1157 kFileSystemRoot, path, kRootUid, allowed_group_ids); |
| 1163 } | 1158 } |
| 1164 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 1159 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 1165 | 1160 |
| 1166 } // namespace file_util | 1161 } // namespace file_util |
| OLD | NEW |