summaryrefslogtreecommitdiffstats
path: root/dom/ipc
diff options
context:
space:
mode:
authorAndrea Marchesini <amarchesini@mozilla.com>2018-05-10 11:24:25 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-06-07 06:10:12 +0200
commitf35bf8b65d25f88c7e34263337b05619a78868f6 (patch)
tree4393c0770d7cd0bacce82e790569fef4a6501c3a /dom/ipc
parente597487f31726085464a6188ad004fb10fad8305 (diff)
downloadUXP-f35bf8b65d25f88c7e34263337b05619a78868f6.tar
UXP-f35bf8b65d25f88c7e34263337b05619a78868f6.tar.gz
UXP-f35bf8b65d25f88c7e34263337b05619a78868f6.tar.lz
UXP-f35bf8b65d25f88c7e34263337b05619a78868f6.tar.xz
UXP-f35bf8b65d25f88c7e34263337b05619a78868f6.zip
Bug 1459206 - Use FileSystemSecurity in ContentParent::RecvGetFilesRequest. r=ehsan, a=jcristau
--HG-- extra : rebase_source : 542dca7fe46dd965ecde4c8387685beaf20ec3de
Diffstat (limited to 'dom/ipc')
-rw-r--r--dom/ipc/ContentParent.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index 3488e26bd..fb97adc42 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -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,