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

Unified Diff: base/platform_file.h

Issue 12095045: Merge 175642 (also includes 175980) (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « base/file_util.cc ('k') | base/platform_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file.h
===================================================================
--- base/platform_file.h (revision 179457)
+++ base/platform_file.h (working copy)
@@ -119,12 +119,22 @@
// Creates or opens the given file. If |created| is provided, it will be set to
// true if a new file was created [or an old one truncated to zero length to
// simulate a new file, which can happen with PLATFORM_FILE_CREATE_ALWAYS], and
-// false otherwise. |error_code| can be NULL.
+// false otherwise. |error| can be NULL.
+//
+// This function fails with 'access denied' if the |name| contains path
+// traversal ('..') components.
BASE_EXPORT PlatformFile CreatePlatformFile(const FilePath& name,
int flags,
bool* created,
- PlatformFileError* error_code);
+ PlatformFileError* error);
+// Same as CreatePlatformFile but allows paths with traversal (like \..\)
+// components. Use only with extreme care.
+BASE_EXPORT PlatformFile CreatePlatformFileUnsafe(const FilePath& name,
+ int flags,
+ bool* created,
+ PlatformFileError* error);
+
// Closes a file handle. Returns |true| on success and |false| otherwise.
BASE_EXPORT bool ClosePlatformFile(PlatformFile file);
« no previous file with comments | « base/file_util.cc ('k') | base/platform_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698