Bug 1506265 - Port bug 1505445: [Mac] With sandbox early startup, start the sandbox after the port exchange. r=jorgk
authorRichard Marti <richard.marti@gmail.com>
Fri, 09 Nov 2018 23:16:30 +0100
changeset 33689 856dd9d687bd3089751b4aae08a5a2f07fd18586
parent 33688 8869c51e099512a60f05bb0c033677470a460052
child 33690 37233a992def692093f85e6b88860bc500869634
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersjorgk
bugs1506265, 1505445, 1504404
Bug 1506265 - Port bug 1505445: [Mac] With sandbox early startup, start the sandbox after the port exchange. r=jorgk Almost complete removal of bug bug 1504404: https://hg.mozilla.org/comm-central/rev/d4e98be4fc0b
mail/app/moz.build
mail/app/nsMailApp.cpp
--- a/mail/app/moz.build
+++ b/mail/app/moz.build
@@ -21,21 +21,16 @@ if CONFIG['LIBFUZZER']:
     LOCAL_INCLUDES += [
         '/%s/tools/fuzzing/libfuzzer' % CONFIG['mozreltopsrcdir'],
     ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     RCINCLUDE = 'splash.rc'
     DEFINES['MOZ_THUNDERBIRD'] = True
 
-if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'Darwin':
-    USE_LIBS += [
-        'mozsandbox',
-    ]
-
 if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
     # For sandbox includes and the include dependencies those have
     LOCAL_INCLUDES += [
         '/%s/security/sandbox/chromium' % CONFIG['mozreltopsrcdir'],
         '/%s/security/sandbox/chromium-shim' % CONFIG['mozreltopsrcdir'],
     ]
 
     USE_LIBS += [
--- a/mail/app/nsMailApp.cpp
+++ b/mail/app/nsMailApp.cpp
@@ -36,20 +36,16 @@
 #include "mozilla/Sprintf.h"
 #include "mozilla/StartupTimeline.h"
 #include "mozilla/WindowsDllBlocklist.h"
 
 #ifdef LIBFUZZER
 #include "FuzzerDefs.h"
 #endif
 
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-#include "mozilla/Sandbox.h"
-#endif
-
 #ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
 #include <cpuid.h>
 #include "mozilla/Unused.h"
 
 static bool
 IsSSE2Available()
 {
   // The rest of the app has been compiled to assume that SSE2 is present
@@ -261,26 +257,16 @@ InitXPCOMGlue()
 // NB: This must be extern, as this value is checked elsewhere
 uint32_t gBlocklistInitFlags = eDllBlocklistInitFlagDefault;
 #endif
 
 int main(int argc, char* argv[], char* envp[])
 {
   mozilla::TimeStamp start = mozilla::TimeStamp::Now();
 
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-  if (argc > 1 && IsArg(argv[1], "contentproc")) {
-    std::string err;
-    if (!mozilla::EarlyStartMacSandboxIfEnabled(argc, argv, err)) {
-      Output("Sandbox error: %s\n", err.c_str());
-      MOZ_CRASH("Sandbox initialization failed");
-    }
-  }
-#endif
-
 #ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
   // We are launching as a content process, delegate to the appropriate
   // main
   if (argc > 1 && IsArg(argv[1], "contentproc")) {
 #ifdef HAS_DLL_BLOCKLIST
     DllBlocklist_Initialize(eDllBlocklistInitFlagIsChildProcess);
 #endif
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)