Title: [290998] trunk
Revision
290998
Author
[email protected]
Date
2022-03-08 10:40:08 -0800 (Tue, 08 Mar 2022)

Log Message

File System Access: disallow empty name in FileSystemHandle
https://bugs.webkit.org/show_bug.cgi?id=237563

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
* web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
* web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
* web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:

Source/WebKit:

Updated expectations of imported wpt tests.

* NetworkProcess/storage/FileSystemStorageHandle.cpp:
(WebKit::isValidFileName):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290997 => 290998)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-08 18:40:08 UTC (rev 290998)
@@ -1,3 +1,15 @@
+2022-03-08  Sihui Liu  <[email protected]>
+
+        File System Access: disallow empty name in FileSystemHandle
+        https://bugs.webkit.org/show_bug.cgi?id=237563
+
+        Reviewed by Youenn Fablet.
+
+        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
+        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
+        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
+        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:
+
 2022-03-08  Alex Christensen  <[email protected]>
 
         WebSocket.send() should synchronously update bufferedAmount

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt (290997 => 290998)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt	2022-03-08 18:40:08 UTC (rev 290998)
@@ -4,7 +4,7 @@
 PASS getDirectoryHandle(create=false) returns existing directories
 PASS getDirectoryHandle(create=true) returns existing directories without erasing
 FAIL getDirectoryHandle() when a file already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
-FAIL getDirectoryHandle() with empty name assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS getDirectoryHandle() with empty name
 PASS getDirectoryHandle() with "." name
 PASS getDirectoryHandle() with ".." name
 PASS getDirectoryHandle(create=false) with a path separator when the directory exists

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt (290997 => 290998)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt	2022-03-08 18:40:08 UTC (rev 290998)
@@ -4,7 +4,7 @@
 PASS getDirectoryHandle(create=false) returns existing directories
 PASS getDirectoryHandle(create=true) returns existing directories without erasing
 FAIL getDirectoryHandle() when a file already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
-FAIL getDirectoryHandle() with empty name assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS getDirectoryHandle() with empty name
 PASS getDirectoryHandle() with "." name
 PASS getDirectoryHandle() with ".." name
 PASS getDirectoryHandle(create=false) with a path separator when the directory exists

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt (290997 => 290998)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt	2022-03-08 18:40:08 UTC (rev 290998)
@@ -4,7 +4,7 @@
 FAIL removeEntry() to remove an empty directory promise_test: Unhandled rejection with value: object "TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)"
 FAIL removeEntry() on a non-empty directory should fail promise_rejects_dom: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
 FAIL removeEntry() on a directory recursively should delete all sub-items promise_test: Unhandled rejection with value: object "TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)"
-FAIL removeEntry() with empty name should fail assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS removeEntry() with empty name should fail
 PASS removeEntry() with "." name should fail
 PASS removeEntry() with ".." name should fail
 PASS removeEntry() with a path separator should fail.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt (290997 => 290998)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt	2022-03-08 18:40:08 UTC (rev 290998)
@@ -4,7 +4,7 @@
 FAIL removeEntry() to remove an empty directory promise_test: Unhandled rejection with value: object "TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)"
 FAIL removeEntry() on a non-empty directory should fail promise_rejects_dom: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
 FAIL removeEntry() on a directory recursively should delete all sub-items promise_test: Unhandled rejection with value: object "TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)"
-FAIL removeEntry() with empty name should fail assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS removeEntry() with empty name should fail
 PASS removeEntry() with "." name should fail
 PASS removeEntry() with ".." name should fail
 PASS removeEntry() with a path separator should fail.

Modified: trunk/Source/WebKit/ChangeLog (290997 => 290998)


--- trunk/Source/WebKit/ChangeLog	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/Source/WebKit/ChangeLog	2022-03-08 18:40:08 UTC (rev 290998)
@@ -1,3 +1,15 @@
+2022-03-08  Sihui Liu  <[email protected]>
+
+        File System Access: disallow empty name in FileSystemHandle
+        https://bugs.webkit.org/show_bug.cgi?id=237563
+
+        Reviewed by Youenn Fablet.
+
+        Updated expectations of imported wpt tests.
+
+        * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+        (WebKit::isValidFileName):
+
 2022-03-08  Alex Christensen  <[email protected]>
 
         Expand adattributiond sandbox to prevent sandbox exceptions during main functionality

Modified: trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp (290997 => 290998)


--- trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp	2022-03-08 17:29:11 UTC (rev 290997)
+++ trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp	2022-03-08 18:40:08 UTC (rev 290998)
@@ -84,7 +84,7 @@
 
 static bool isValidFileName(const String& name)
 {
-    return name != "." && name != ".." && !name.contains(pathSeparator);
+    return !name.isEmpty() && name != "." && name != ".." && !name.contains(pathSeparator);
 }
 
 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::requestCreateHandle(IPC::Connection::UniqueID connection, Type type, String&& name, bool createIfNecessary)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to