Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Unified Diff: sandbox/linux/services/namespace_sandbox.h

Issue 1158793003: Enable one PID namespace per process for NaCl processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable PID namespace per process for nonsfi newlib NaCl as well. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/services/credentials.cc ('k') | sandbox/linux/services/namespace_sandbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/namespace_sandbox.h
diff --git a/sandbox/linux/services/namespace_sandbox.h b/sandbox/linux/services/namespace_sandbox.h
index 1c5c0a0d44b272e32829d820ece4a080b9cc16de..977650e51f360d59c854723e5bfe72d6b2c898e5 100644
--- a/sandbox/linux/services/namespace_sandbox.h
+++ b/sandbox/linux/services/namespace_sandbox.h
@@ -37,8 +37,6 @@ namespace sandbox {
// Credentials::DropAllCapabilities().
class SANDBOX_EXPORT NamespaceSandbox {
public:
- static const int kDefaultExitCode = 1;
-
#if !defined(OS_NACL_NONSFI)
// Launch a new process inside its own user/PID/network namespaces (depending
// on kernel support). Requires at a minimum that user namespaces are
@@ -71,8 +69,8 @@ class SANDBOX_EXPORT NamespaceSandbox {
//
// SIGHUP, SIGINT, SIGABRT, SIGQUIT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
//
- // that exits with kDefaultExitCode. These are signals whose default action is
- // to terminate the program (apart from SIGILL, SIGFPE, and SIGSEGV, which
+ // that exits with SignalExitCode(sig). These are signals whose default action
+ // is to terminate the program (apart from SIGILL, SIGFPE, and SIGSEGV, which
// will still terminate the process if e.g. an illegal instruction is
// encountered, etc.).
//
@@ -85,6 +83,10 @@ class SANDBOX_EXPORT NamespaceSandbox {
// false.
static bool InstallTerminationSignalHandler(int sig, int exit_code);
+ // Returns an exit code corresponding to the process being killed by sig. This
+ // is the same as exit code that NaCl's default signal handler uses.
+ static int SignalExitCode(int sig) { return -sig & 0xff; }
+
// Returns whether the namespace sandbox created a new user, PID, and network
// namespace. In particular, InNewUserNamespace should return true iff the
// process was started via this class.
« no previous file with comments | « sandbox/linux/services/credentials.cc ('k') | sandbox/linux/services/namespace_sandbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698