mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Bug 1459206 - Use FileSystemSecurity in ContentParent::RecvGetFilesRequest. r=ehsan, a=jcristau
--HG-- extra : rebase_source : 542dca7fe46dd965ecde4c8387685beaf20ec3de
This commit is contained in:
parent
ad7843d169
commit
014062bb24
2 changed files with 9 additions and 0 deletions
|
|
@ -152,6 +152,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4721,6 +4721,14 @@ ContentParent::RecvGetFilesRequest(const nsID& aUUID,
|
|||
{
|
||||
MOZ_ASSERT(!mGetFilesPendingRequests.GetWeak(aUUID));
|
||||
|
||||
if (!mozilla::Preferences::GetBool("dom.filesystem.pathcheck.disabled", false)) {
|
||||
RefPtr<FileSystemSecurity> fss = FileSystemSecurity::Get();
|
||||
if (NS_WARN_IF(!fss ||
|
||||
!fss->ContentProcessHasAccessTo(ChildID(), aDirectoryPath))) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
RefPtr<GetFilesHelper> helper =
|
||||
GetFilesHelperParent::Create(aUUID, aDirectoryPath, aRecursiveFlag, this,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue