예제 #1
0
        /// <nodoc />
        public SandboxExecRunner(Options options)
        {
            m_options           = options;
            s_crashCollector    = OperatingSystemHelper.IsUnixOS ? new CrashCollectorMacOS(new[] { CrashType.SandboxExec, CrashType.Kernel }) : null;
            m_sandboxConnection = OperatingSystemHelper.IsUnixOS
                ?
#if PLATFORM_OSX
                                  m_options.UseEndpointSecuritySandbox
                    ? (ISandboxConnection) new SandboxConnectionES()
                    :
#endif
                                  (ISandboxConnection) new SandboxConnectionKext(
                new SandboxConnectionKext.Config
            {
                FailureCallback = (int status, string description) =>
                {
                    m_sandboxConnection.Dispose();
                    throw new SystemException($"Received unrecoverable error from the sandbox (Code: {status.ToString("X")}, Description: {description}), please reload the extension and retry.");
                },
                KextConfig = new Sandbox.KextConfig
                {
                    ReportQueueSizeMB    = m_options.ReportQueueSizeMB,
                    EnableReportBatching = m_options.EnableReportBatching,
#if PLATFORM_OSX
                    EnableCatalinaDataPartitionFiltering = OperatingSystemHelper.IsMacOSCatalinaOrHigher
#endif
                },
            })
                : null;
        }
예제 #2
0
 private void SandboxConnectionFailureCallback(int status, string description)
 {
     m_sandboxConnection?.Dispose();
     throw new SystemException($"Received unrecoverable error from the sandbox (Code: {status:X}, Description: {description}), please reload the extension and retry.");
 }