diff --git a/dom/filesystem/tests/test_webkitdirectory.html b/dom/filesystem/tests/test_webkitdirectory.html index 3611039a5a46..45957f9bb56d 100644 --- a/dom/filesystem/tests/test_webkitdirectory.html +++ b/dom/filesystem/tests/test_webkitdirectory.html @@ -151,6 +151,7 @@ function test_changeDataWhileWorking() { function test_setup() { SpecialPowers.pushPrefEnv({"set": [["dom.input.dirpicker", true], + ["dom.filesystem.pathcheck.disabled", true], ["dom.webkitBlink.dirPicker.enabled", true]]}, next); } diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 1cefd701a011..63f74cdc0fff 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -5249,6 +5249,14 @@ ContentParent::RecvGetFilesRequest(const nsID& aUUID, { MOZ_ASSERT(!mGetFilesPendingRequests.GetWeak(aUUID)); + if (!mozilla::Preferences::GetBool("dom.filesystem.pathcheck.disabled", false)) { + RefPtr fss = FileSystemSecurity::Get(); + if (NS_WARN_IF(!fss || + !fss->ContentProcessHasAccessTo(ChildID(), aDirectoryPath))) { + return IPC_FAIL_NO_REASON(this); + } + } + ErrorResult rv; RefPtr helper = GetFilesHelperParent::Create(aUUID, aDirectoryPath, aRecursiveFlag, this,