Bug 1419673 - Only check font paths against sandbox policy if read sandboxing is enabled. r=gcp

This commit is contained in:
Jonathan Kew 2017-11-22 11:10:20 +00:00
Родитель 442a9cd5f0
Коммит dee38e2ed4
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -1486,10 +1486,11 @@ gfxFcPlatformFontList::InitFontListForPlatform()
UniquePtr<SandboxPolicy> policy;
#ifdef MOZ_CONTENT_SANDBOX
// Create a temporary SandboxPolicy to check font paths; use a fake PID
// to avoid picking up any PID-specific rules by accident.
// If read sandboxing is enabled, create a temporary SandboxPolicy to
// check font paths; use a fake PID to avoid picking up any PID-specific
// rules by accident.
SandboxBrokerPolicyFactory policyFactory;
if (GetEffectiveContentSandboxLevel() > 0 &&
if (GetEffectiveContentSandboxLevel() > 2 &&
!PR_GetEnv("MOZ_DISABLE_CONTENT_SANDBOX")) {
policy = policyFactory.GetContentPolicy(-1, false);
}