Commit fc6a727b authored by kinuko@chromium.org's avatar kinuko@chromium.org

Do not return file descriptor if target is a directory in IsolatedFileSystem

BUG=233029

Review URL: https://chromiumcodereview.appspot.com/14079005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195171 0039d316-1c4b-4281-b951-d872f2087c98
parent b8319781
...@@ -85,6 +85,8 @@ PlatformFileError NativeFileUtil::CreateOrOpen( ...@@ -85,6 +85,8 @@ PlatformFileError NativeFileUtil::CreateOrOpen(
// If its parent does not exist, should return NOT_FOUND error. // If its parent does not exist, should return NOT_FOUND error.
return base::PLATFORM_FILE_ERROR_NOT_FOUND; return base::PLATFORM_FILE_ERROR_NOT_FOUND;
} }
if (file_util::DirectoryExists(path))
return base::PLATFORM_FILE_ERROR_NOT_A_FILE;
PlatformFileError error_code = base::PLATFORM_FILE_OK; PlatformFileError error_code = base::PLATFORM_FILE_OK;
*file_handle = base::CreatePlatformFile(path, file_flags, *file_handle = base::CreatePlatformFile(path, file_flags,
created, &error_code); created, &error_code);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment