зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1120045 - Pref off allowing media plugins on Linux systems which can't sandbox them. r=jesup
This does *not* affect the sandboxing requirement for EME CDMs added in bug 1074561; that is enforced separately and regardless of this pref. Bonus fix: GC unused includes of sandbox headers.
This commit is contained in:
Родитель
0225ce362d
Коммит
fef2dc290e
|
@ -37,9 +37,6 @@ static const int MAX_VOUCHER_LENGTH = 500000;
|
|||
#if defined(XP_WIN)
|
||||
#define TARGET_SANDBOX_EXPORTS
|
||||
#include "mozilla/sandboxTarget.h"
|
||||
#elif defined (XP_LINUX)
|
||||
#include "mozilla/Sandbox.h"
|
||||
#include "mozilla/SandboxInfo.h"
|
||||
#elif defined(XP_MACOSX)
|
||||
#include "mozilla/Sandbox.h"
|
||||
#endif
|
||||
|
|
|
@ -775,6 +775,15 @@ class CreateGMPParentTask : public nsRunnable {
|
|||
public:
|
||||
NS_IMETHOD Run() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
|
||||
if (!SandboxInfo::Get().CanSandboxMedia()) {
|
||||
if (!Preferences::GetBool("media.gmp.insecure.allow")) {
|
||||
NS_WARNING("Denying media plugin load due to lack of sandboxing.");
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
NS_WARNING("Loading media plugin despite lack of sandboxing.");
|
||||
}
|
||||
#endif
|
||||
mParent = new GMPParent();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -832,7 +841,7 @@ GeckoMediaPluginService::AddOnGMPThread(const nsAString& aDirectory)
|
|||
MOZ_ASSERT(mainThread);
|
||||
mozilla::SyncRunnable::DispatchToThread(mainThread, task);
|
||||
nsRefPtr<GMPParent> gmp = task->GetParent();
|
||||
rv = gmp->Init(this, directory);
|
||||
rv = gmp ? gmp->Init(this, directory) : NS_ERROR_NOT_AVAILABLE;
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Can't Create GMPParent");
|
||||
return;
|
||||
|
|
|
@ -4541,3 +4541,10 @@ pref("reader.font_type", "sans-serif");
|
|||
// Whether or not the user has interacted with the reader mode toolbar.
|
||||
// This is used to show a first-launch tip in reader mode.
|
||||
pref("reader.has_used_toolbar", false);
|
||||
|
||||
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
|
||||
// Whether to allow, on a Linux system that doesn't support the necessary sandboxing
|
||||
// features, loading Gecko Media Plugins unsandboxed. However, EME CDMs will not be
|
||||
// loaded without sandboxing even if this pref is changed.
|
||||
pref("media.gmp.insecure.allow", false);
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче