File scheme should not allow access of a resource on a different volume.
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jun 2016 00:03:04 +0000 (00:03 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jun 2016 00:03:04 +0000 (00:03 +0000)
commit2ba43fdd161ad60600147b6954608bd4a6844bc5
tree58481101ff64bd54803f75c2995172779bafc31e
parentc4ebdec664506e850eea10766ba704dba0cfa7f3
File scheme should not allow access of a resource on a different volume.
https://bugs.webkit.org/show_bug.cgi?id=158552
<rdar://problem/15307582>

Patch by Pranjal Jumde <pjumde@apple.com> on 2016-06-17
Reviewed by Brent Fulgham.

Source/WebCore:

Tests: Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay):
* platform/FileSystem.cpp:
(WebCore::platformFileStat):
(WebCore::filesHaveSameVolume):
Returns true if the files are on the same volume
* platform/FileSystem.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.html: Added.
* TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm: Added.
(-[CrossPartitionFileSchemeAccessNavigationDelegate webView:didFinishNavigation:]):
When the main page load is complete fetch the contents of the document to check if iframe was loaded
(createPartition):
Create a disk image and load the contents of the file.
(cleanUp):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/platform/FileSystem.cpp
Source/WebCore/platform/FileSystem.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm [new file with mode: 0644]