Bug 1380110 Fix --disable-sandbox by adding #if guards r?handyman draft
authorTom Ritter <tom@mozilla.com>
Wed, 12 Jul 2017 09:31:39 -0500
changeset 607610 d7f486ff3c4cecafe7add0e9581c75e6b39787c5
parent 607604 0101d8d42bf6f3cd948a1e7d697183284ea394f0
child 637082 88d2cf949e885b31a028343da202ddf556ca4e05
push id68040
push userbmo:tom@mozilla.com
push dateWed, 12 Jul 2017 14:32:26 +0000
reviewershandyman
bugs1380110
milestone56.0a1
Bug 1380110 Fix --disable-sandbox by adding #if guards r?handyman MozReview-Commit-ID: ETjN2KTUi4l
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4464,20 +4464,22 @@ XREMain::XRE_mainRun()
   // Ugly details in http://bugzil.la/1175039#c27
   char appFile[MAX_PATH];
   if (GetEnvironmentVariableA("XUL_APP_FILE", appFile, sizeof(appFile))) {
     SmprintfPointer saved = mozilla::Smprintf("XUL_APP_FILE=%s", appFile);
     // We intentionally leak the string here since it is required by PR_SetEnv.
     PR_SetEnv(saved.release());
   }
 
+#if defined(MOZ_SANDBOX)
   // Call SandboxBroker to cache directories needed for policy rules, this must
   // be called after mDirProvider.DoStartup as it needs the profile dir.
   SandboxBroker::CacheRulesDirectories();
 #endif
+#endif
 
   SaveStateForAppInitiatedRestart();
 
   // clear out any environment variables which may have been set
   // during the relaunch process now that we know we won't be relaunching.
   SaveToEnv("XRE_PROFILE_PATH=");
   SaveToEnv("XRE_PROFILE_LOCAL_PATH=");
   SaveToEnv("XRE_PROFILE_NAME=");