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

Side by Side Diff: sandbox/linux/suid/sandbox.c

Issue 7708020: Trying again to land OOM priority manager changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving switch closer to use location Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« base/process_util.h ('K') | « sandbox/linux/suid/process_util_linux.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox 5 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
6 6
7 #define _GNU_SOURCE 7 #define _GNU_SOURCE
8 #include <asm/unistd.h> 8 #include <asm/unistd.h>
9 #include <errno.h> 9 #include <errno.h>
10 #include <fcntl.h> 10 #include <fcntl.h>
11 #include <limits.h> 11 #include <limits.h>
(...skipping 18 matching lines...) Expand all
30 #include "process_util.h" 30 #include "process_util.h"
31 #include "suid_unsafe_environment_variables.h" 31 #include "suid_unsafe_environment_variables.h"
32 32
33 #if !defined(CLONE_NEWPID) 33 #if !defined(CLONE_NEWPID)
34 #define CLONE_NEWPID 0x20000000 34 #define CLONE_NEWPID 0x20000000
35 #endif 35 #endif
36 #if !defined(CLONE_NEWNET) 36 #if !defined(CLONE_NEWNET)
37 #define CLONE_NEWNET 0x40000000 37 #define CLONE_NEWNET 0x40000000
38 #endif 38 #endif
39 39
40 static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score";
40 static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D"; 41 static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D";
41 static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID"; 42 static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID";
42 43
43 // These are the magic byte values which the sandboxed process uses to request 44 // These are the magic byte values which the sandboxed process uses to request
44 // that it be chrooted. 45 // that it be chrooted.
45 static const char kMsgChrootMe = 'C'; 46 static const char kMsgChrootMe = 'C';
46 static const char kMsgChrootSuccessful = 'O'; 47 static const char kMsgChrootSuccessful = 'O';
47 48
48 static void FatalError(const char *msg, ...) 49 static void FatalError(const char *msg, ...)
49 __attribute__((noreturn, format(printf, 1, 2))); 50 __attribute__((noreturn, format(printf, 1, 2)));
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (!DropRoot()) 348 if (!DropRoot())
348 return 1; 349 return 1;
349 if (!SetupChildEnvironment()) 350 if (!SetupChildEnvironment())
350 return 1; 351 return 1;
351 352
352 execv(argv[1], &argv[1]); 353 execv(argv[1], &argv[1]);
353 FatalError("execv failed"); 354 FatalError("execv failed");
354 355
355 return 1; 356 return 1;
356 } 357 }
OLDNEW
« base/process_util.h ('K') | « sandbox/linux/suid/process_util_linux.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698