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

Unified Diff: base/file_util_posix.cc

Issue 7085005: Disallow links from being seen by the extensions via the fileapi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix. Created 9 years, 7 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: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 28d6a61578a4b50a063616a84cbc44ca2a8274e5..99025d068482aa40182b59aa9c5b8fa79982e892 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -522,6 +522,23 @@ bool CreateDirectory(const FilePath& full_path) {
return true;
}
+#if defined(OS_CHROMEOS)
+// TODO(rkc): Refactor GetFileInfo and FileEnumerator to handle symlinks
+// correctly; this is just a hack to fix symlink handling for now for ChromeOS
+bool IsLink(const FilePath& file_path) {
+ struct stat st;
+ // If we can't lstat the file, it's safe to assume that the file won't at
+ // least be a 'followable' link
+ if (lstat(file_path.value().c_str(), &st) != 0)
+ return false;
+
+ if (S_ISLNK(st.st_mode))
+ return true;
+ else
+ return false;
+}
+#endif
+
bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) {
stat_wrapper_t file_info;
if (CallStat(file_path.value().c_str(), &file_info) != 0)

Powered by Google App Engine
This is Rietveld 408576698