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

Side by Side Diff: content/renderer/renderer_main_platform_delegate_linux.cc

Issue 13814027: Linux: make current InitializeSandbox() private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove sandbox_init_linux.cc Created 7 years, 8 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
« no previous file with comments | « content/public/common/sandbox_init.h ('k') | content/utility/utility_main.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/renderer/renderer_main_platform_delegate.h" 5 #include "content/renderer/renderer_main_platform_delegate.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 24 matching lines...) Expand all
35 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox 35 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
36 return true; 36 return true;
37 } 37 }
38 38
39 bool RendererMainPlatformDelegate::EnableSandbox() { 39 bool RendererMainPlatformDelegate::EnableSandbox() {
40 // The setuid sandbox is started in the zygote process: zygote_main_linux.cc 40 // The setuid sandbox is started in the zygote process: zygote_main_linux.cc
41 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox 41 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
42 // 42 //
43 // The seccomp sandbox mode 1 (sandbox/linux/seccomp-legacy) and mode 2 43 // The seccomp sandbox mode 1 (sandbox/linux/seccomp-legacy) and mode 2
44 // (sandbox/linux/seccomp-bpf) are started in InitializeSandbox(). 44 // (sandbox/linux/seccomp-bpf) are started in InitializeSandbox().
45 InitializeSandbox(); 45 LinuxSandbox::InitializeSandbox();
46 return true; 46 return true;
47 } 47 }
48 48
49 void RendererMainPlatformDelegate::RunSandboxTests(bool no_sandbox) { 49 void RendererMainPlatformDelegate::RunSandboxTests(bool no_sandbox) {
50 // The LinuxSandbox class requires going through initialization before 50 // The LinuxSandbox class requires going through initialization before
51 // GetStatus() and others can be used. When we are not launched through the 51 // GetStatus() and others can be used. When we are not launched through the
52 // Zygote, this initialization will only happen in the renderer process if 52 // Zygote, this initialization will only happen in the renderer process if
53 // EnableSandbox() above is called, which it won't necesserily be. 53 // EnableSandbox() above is called, which it won't necesserily be.
54 // This only happens with flags such as --renderer-cmd-prefix which are 54 // This only happens with flags such as --renderer-cmd-prefix which are
55 // for debugging. 55 // for debugging.
(...skipping 21 matching lines...) Expand all
77 errno = 0; 77 errno = 0;
78 // This should normally return EBADF since the first argument is bogus, 78 // This should normally return EBADF since the first argument is bogus,
79 // but we know that under the seccomp-bpf sandbox, this should return EPERM. 79 // but we know that under the seccomp-bpf sandbox, this should return EPERM.
80 CHECK_EQ(fchmod(-1, 07777), -1); 80 CHECK_EQ(fchmod(-1, 07777), -1);
81 CHECK_EQ(errno, EPERM); 81 CHECK_EQ(errno, EPERM);
82 } 82 }
83 #endif // __x86_64__ 83 #endif // __x86_64__
84 } 84 }
85 85
86 } // namespace content 86 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/sandbox_init.h ('k') | content/utility/utility_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698