Bug 1287426 Part 4: Re-apply pre-vista stdout/err process inheritance change to Chromium code after merge. r=tabraldes
authorBob Owen <bobowencode@gmail.com>
Tue, 18 Nov 2014 15:11:47 +0000
changeset 312803 00d1d90c348b5f5edd2a5a42306d1771742bb06c
parent 312802 a46f0e32289bb8975eef7f87d14cbd71c9c10582
child 312804 a05726163a79b404bf3248a86e3261e44cf50793
push id30658
push usercbook@mozilla.com
push dateTue, 06 Sep 2016 13:28:59 +0000
treeherdermozilla-central@bec2b7e3c0eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstabraldes
bugs1287426
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1287426 Part 4: Re-apply pre-vista stdout/err process inheritance change to Chromium code after merge. r=tabraldes Originally landed as changset: https://hg.mozilla.org/mozilla-central/rev/f94a07671389 MozReview-Commit-ID: 2dpjBXkzlze
security/sandbox/chromium/sandbox/win/src/broker_services.cc
security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt
--- a/security/sandbox/chromium/sandbox/win/src/broker_services.cc
+++ b/security/sandbox/chromium/sandbox/win/src/broker_services.cc
@@ -404,16 +404,24 @@ ResultCode BrokerServicesBase::SpawnTarg
       startup_info.startup_info()->dwFlags |= STARTF_USESTDHANDLES;
       startup_info.startup_info()->hStdInput = INVALID_HANDLE_VALUE;
       startup_info.startup_info()->hStdOutput = stdout_handle;
       startup_info.startup_info()->hStdError = stderr_handle;
       // Allowing inheritance of handles is only secure now that we
       // have limited which handles will be inherited.
       inherit_handles = true;
     }
+  } else if (getenv("MOZ_WIN_INHERIT_STD_HANDLES_PRE_VISTA")) {
+    // On pre-Vista versions even if we can't limit what gets inherited, we
+    // sometimes want to inherit stdout/err for testing purposes.
+    startup_info.startup_info()->dwFlags |= STARTF_USESTDHANDLES;
+    startup_info.startup_info()->hStdInput = INVALID_HANDLE_VALUE;
+    startup_info.startup_info()->hStdOutput = policy_base->GetStdoutHandle();
+    startup_info.startup_info()->hStdError = policy_base->GetStderrHandle();
+    inherit_handles = true;
   }
 
   // Construct the thread pool here in case it is expensive.
   // The thread pool is shared by all the targets
   if (NULL == thread_pool_)
     thread_pool_ = new Win2kThreadPool();
 
   // Create the TargetProces object and spawn the target suspended. Note that
--- a/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt
+++ b/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt
@@ -1,8 +1,8 @@
 Please add a link to the bugzilla bug and patch name that should be re-applied.
 Also, please update any existing links to their actual mozilla-central changeset.
 
-https://hg.mozilla.org/mozilla-central/rev/efa7518e43b0
+https://bugzilla.mozilla.org/show_bug.cgi?id=1287426 bug1287426part4.patch
 https://hg.mozilla.org/mozilla-central/rev/421446ab2347
 https://hg.mozilla.org/mozilla-central/rev/7df8d6639971
 https://hg.mozilla.org/mozilla-central/rev/afa4f68de47c
 https://bugzilla.mozilla.org/show_bug.cgi?id=1273852