Skip to content

Commit

Permalink
Bug 1445614: Only warn when SetAlternateDesktop fails. r=jimm a=jcristau
Browse files Browse the repository at this point in the history
--HG--
extra : source : 159e1105bdc754d0b8e83915bf18fc418167ead6
  • Loading branch information
bobowen committed Mar 14, 2018
1 parent ac9ce2b commit 7d367e8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
Original file line number Diff line number Diff line change
@@ -451,8 +451,10 @@ SandboxBroker::SetSecurityLevelForContentProcess(int32_t aSandboxLevel,

if (aSandboxLevel > 4) {
result = mPolicy->SetAlternateDesktop(false);
MOZ_RELEASE_ASSERT(sandbox::SBOX_ALL_OK == result,
"Failed to create alternate desktop for sandbox.");
if (NS_WARN_IF(result != sandbox::SBOX_ALL_OK)) {
LOG_W("SetAlternateDesktop failed, result: %i, last error: %x",
result, ::GetLastError());
}
}

if (aSandboxLevel > 3) {
@@ -849,8 +851,10 @@ SandboxBroker::SetSecurityLevelForPDFiumProcess()
"SetTokenLevel should never fail with these arguments, what happened?");

result = mPolicy->SetAlternateDesktop(true);
SANDBOX_ENSURE_SUCCESS(result,
"Failed to create alternate desktop for sandbox.");
if (NS_WARN_IF(result != sandbox::SBOX_ALL_OK)) {
LOG_W("SetAlternateDesktop failed, result: %i, last error: %x",
result, ::GetLastError());
}

result = mPolicy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
MOZ_ASSERT(sandbox::SBOX_ALL_OK == result,
@@ -928,8 +932,10 @@ SandboxBroker::SetSecurityLevelForGMPlugin(SandboxLevel aLevel)
"SetTokenLevel should never fail with these arguments, what happened?");

result = mPolicy->SetAlternateDesktop(true);
SANDBOX_ENSURE_SUCCESS(result,
"Failed to create alternate desktop for sandbox.");
if (NS_WARN_IF(result != sandbox::SBOX_ALL_OK)) {
LOG_W("SetAlternateDesktop failed, result: %i, last error: %x",
result, ::GetLastError());
}

result = mPolicy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
MOZ_ASSERT(sandbox::SBOX_ALL_OK == result,

0 comments on commit 7d367e8

Please sign in to comment.