Bug 1272062 - Merge security/sandbox/linux/common into its parent directory. r=gcp
authorJed Davis <jld@mozilla.com>
Thu, 27 Oct 2016 22:06:00 +0200
changeset 320814 b5e30ab177beaff7d380982bad1d27e769481771
parent 320813 970a2877f18432f932fad7ed280792d83b554aa8
child 320815 6b931b75a6d2628370aa55ff8e472bcb50263abd
push id83461
push usercbook@mozilla.com
push dateThu, 03 Nov 2016 16:02:44 +0000
treeherdermozilla-inbound@b5e30ab177be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1272062
milestone52.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 1272062 - Merge security/sandbox/linux/common into its parent directory. r=gcp Now that SandboxInfo is always part of libmozsandbox, instead of being in different places depending on widget, it doesn't need to be a separate directory anymore. Also updates a few comments that referenced it.
security/sandbox/linux/LinuxSched.h
security/sandbox/linux/Sandbox.h
security/sandbox/linux/SandboxChroot.h
security/sandbox/linux/SandboxInfo.cpp
security/sandbox/linux/SandboxInfo.h
security/sandbox/linux/broker/moz.build
security/sandbox/linux/common/LinuxSched.h
security/sandbox/linux/common/SandboxInfo.cpp
security/sandbox/linux/common/SandboxInfo.h
security/sandbox/linux/common/moz.build
security/sandbox/linux/gtest/moz.build
security/sandbox/linux/moz.build
rename from security/sandbox/linux/common/LinuxSched.h
rename to security/sandbox/linux/LinuxSched.h
--- a/security/sandbox/linux/Sandbox.h
+++ b/security/sandbox/linux/Sandbox.h
@@ -6,17 +6,17 @@
 
 #ifndef mozilla_Sandbox_h
 #define mozilla_Sandbox_h
 
 #include "mozilla/Types.h"
 #include "nsXULAppAPI.h"
 
 // This defines the entry points for a content process to start
-// sandboxing itself.  See also common/SandboxInfo.h for what parts of
+// sandboxing itself.  See also SandboxInfo.h for what parts of
 // sandboxing are enabled/supported.
 
 namespace mozilla {
 
 // This must be called early, while the process is still single-threaded.
 MOZ_EXPORT void SandboxEarlyInit(GeckoProcessType aType);
 
 #ifdef MOZ_CONTENT_SANDBOX
--- a/security/sandbox/linux/SandboxChroot.h
+++ b/security/sandbox/linux/SandboxChroot.h
@@ -9,17 +9,17 @@
 
 #include <pthread.h>
 
 #include "mozilla/Attributes.h"
 
 // This class uses the chroot(2) system call and Linux namespaces to
 // revoke the process's access to the filesystem.  It requires that
 // the process be able to create user namespaces; this is the
-// kHasUserNamespaces in common/SandboxInfo.h.
+// kHasUserNamespaces in SandboxInfo.h.
 //
 // Usage: call Prepare() from a thread with CAP_SYS_CHROOT in its
 // effective capability set, then later call Invoke() when ready to
 // drop filesystem access.  Prepare() creates a thread to do the
 // chrooting, so the caller can (and should!) drop its own
 // capabilities afterwards.  When Invoke() returns, the thread will
 // have exited.
 //
rename from security/sandbox/linux/common/SandboxInfo.cpp
rename to security/sandbox/linux/SandboxInfo.cpp
rename from security/sandbox/linux/common/SandboxInfo.h
rename to security/sandbox/linux/SandboxInfo.h
--- a/security/sandbox/linux/broker/moz.build
+++ b/security/sandbox/linux/broker/moz.build
@@ -16,18 +16,17 @@ SOURCES += [
     'SandboxBrokerPolicyFactory.cpp',
 ]
 
 if CONFIG['OS_TARGET'] == 'Android':
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
         DEFINES['HAVE_ANDROID_OS'] = True
 
 LOCAL_INCLUDES += [
-    '/security/sandbox/linux', # SandboxLogging.h
-    '/security/sandbox/linux/common', # SandboxInfo.h
+    '/security/sandbox/linux', # SandboxLogging.h, SandboxInfo.h
 ]
 
 # Need this for mozilla::ipc::FileDescriptor etc.
 include('/ipc/chromium/chromium-config.mozbuild')
 
 # Need this for safe_sprintf.h used by SandboxLogging.h,
 # but it has to be after ipc/chromium/src.
 LOCAL_INCLUDES += [
deleted file mode 100644
--- a/security/sandbox/linux/common/moz.build
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- Mode: python; python-indent: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS.mozilla += [
-    'SandboxInfo.h',
-]
-
-SOURCES += [
-    'SandboxInfo.cpp',
-]
-
-LOCAL_INCLUDES += [
-    '/security/sandbox/chromium',
-    '/security/sandbox/linux', # SandboxLogging.h
-]
-
-FINAL_LIBRARY = 'mozsandbox'
--- a/security/sandbox/linux/gtest/moz.build
+++ b/security/sandbox/linux/gtest/moz.build
@@ -11,17 +11,16 @@ SOURCES = [
     '../SandboxUtil.cpp',
     'TestBroker.cpp',
     'TestBrokerPolicy.cpp',
     'TestSandboxUtil.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/security/sandbox/linux',
-    '/security/sandbox/linux/common',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/security/sandbox/chromium',
 ]
 
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -10,16 +10,17 @@ SharedLibrary('mozsandbox')
 # this needs to match mozglue/build/moz.build:
 if CONFIG['OS_TARGET'] == 'Android':
     USE_LIBS += [
         'mozglue',
     ]
 
 EXPORTS.mozilla += [
     'Sandbox.h',
+    'SandboxInfo.h',
 ]
 
 SOURCES += [
     '../chromium-shim/base/logging.cpp',
     '../chromium/base/at_exit.cc',
     '../chromium/base/callback_internal.cc',
     '../chromium/base/lazy_instance.cc',
     '../chromium/base/memory/ref_counted.cc',
@@ -58,16 +59,17 @@ SOURCES += [
     '../chromium/sandbox/linux/services/syscall_wrappers.cc',
     'broker/SandboxBrokerCommon.cpp',
     'LinuxCapabilities.cpp',
     'Sandbox.cpp',
     'SandboxBrokerClient.cpp',
     'SandboxChroot.cpp',
     'SandboxFilter.cpp',
     'SandboxFilterUtil.cpp',
+    'SandboxInfo.cpp',
     'SandboxLogging.cpp',
     'SandboxUtil.cpp',
 ]
 
 # This copy of SafeSPrintf doesn't need to avoid the Chromium logging
 # dependency like the one in libxul does, but this way the behavior is
 # consistent.  See also the comment in SandboxLogging.h.
 SOURCES['../chromium/base/strings/safe_sprintf.cc'].flags += ['-DNDEBUG']
@@ -86,30 +88,29 @@ if CONFIG['GNU_CXX']:
 # from the function using it which breaks the build.  Work around that by
 # forcing there to be only one partition.
 if '-flto' in CONFIG['OS_CXXFLAGS'] and not CONFIG['CLANG_CXX']:
     LDFLAGS += ['--param lto-partitions=1']
 
 DEFINES['NS_NO_XPCOM'] = True
 DISABLE_STL_WRAPPING = True
 
-LOCAL_INCLUDES += ['/security/sandbox/linux/common']
+LOCAL_INCLUDES += ['/security/sandbox/linux']
 LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']
 LOCAL_INCLUDES += ['/security/sandbox/chromium']
 LOCAL_INCLUDES += ['/nsprpub']
 
 
 if CONFIG['OS_TARGET'] != 'Android':
     # Needed for clock_gettime with glibc < 2.17:
     OS_LIBS += [
         'rt',
     ]
 
 DIRS += [
     'broker',
-    'common',
     'glue',
     'interpose',
 ]
 
 TEST_DIRS += [
     'gtest',
 ]