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

Side by Side Diff: sandbox/linux/suid/client/setuid_sandbox_client.h

Issue 226083005: Linux sandbox: componentize almost everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update dependencies. Created 6 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 | « sandbox/linux/services/yama.h ('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) 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 #ifndef SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_ 5 #ifndef SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_
6 #define SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_ 6 #define SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback_forward.h" 9 #include "base/callback_forward.h"
10 #include "sandbox/linux/sandbox_export.h"
10 11
11 namespace base { class Environment; } 12 namespace base { class Environment; }
12 13
13 namespace sandbox { 14 namespace sandbox {
14 15
15 // Helper class to use the setuid sandbox. This class is to be used both 16 // Helper class to use the setuid sandbox. This class is to be used both
16 // before launching the setuid helper and after being executed through the 17 // before launching the setuid helper and after being executed through the
17 // setuid helper. 18 // setuid helper.
18 // 19 //
19 // A typical use would be: 20 // A typical use would be:
20 // 1. The browser calls SetupLaunchEnvironment() 21 // 1. The browser calls SetupLaunchEnvironment()
21 // 2. The browser launches a renderer through the setuid sandbox. 22 // 2. The browser launches a renderer through the setuid sandbox.
22 // 3. The renderer requests being chroot-ed through ChrootMe() and 23 // 3. The renderer requests being chroot-ed through ChrootMe() and
23 // requests other sandboxing status via the status functions. 24 // requests other sandboxing status via the status functions.
24 class SetuidSandboxClient { 25 class SANDBOX_EXPORT SetuidSandboxClient {
25 public: 26 public:
26 // All instantation should go through this factory method. 27 // All instantation should go through this factory method.
27 static class SetuidSandboxClient* Create(); 28 static class SetuidSandboxClient* Create();
28 ~SetuidSandboxClient(); 29 ~SetuidSandboxClient();
29 30
30 // Ask the setuid helper over the setuid sandbox IPC channel to chroot() us 31 // Ask the setuid helper over the setuid sandbox IPC channel to chroot() us
31 // to an empty directory. 32 // to an empty directory.
32 // Will only work if we have been launched through the setuid helper. 33 // Will only work if we have been launched through the setuid helper.
33 bool ChrootMe(); 34 bool ChrootMe();
34 // When a new PID namespace is created, the process with pid == 1 should 35 // When a new PID namespace is created, the process with pid == 1 should
(...skipping 21 matching lines...) Expand all
56 // Holds the environment. Will never be NULL. 57 // Holds the environment. Will never be NULL.
57 base::Environment* env_; 58 base::Environment* env_;
58 bool sandboxed_; 59 bool sandboxed_;
59 DISALLOW_IMPLICIT_CONSTRUCTORS(SetuidSandboxClient); 60 DISALLOW_IMPLICIT_CONSTRUCTORS(SetuidSandboxClient);
60 }; 61 };
61 62
62 } // namespace sandbox 63 } // namespace sandbox
63 64
64 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_ 65 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_
65 66
OLDNEW
« no previous file with comments | « sandbox/linux/services/yama.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698