mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 18:24:02 +00:00
Bug 1459206 - Use FileSystemSecurity in ContentParent::RecvGetFilesRequest, r=ehsan
This commit is contained in:
parent
913f117401
commit
bb4ddb115c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -5249,6 +5249,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…
x
Reference in New Issue
Block a user