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

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

Issue 10843059: Create a LinuxSandbox class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « content/zygote/zygote_main_linux.cc ('k') | sandbox/linux/suid/client/setuid_sandbox_client.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 #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/environment.h" 9
10 namespace base { class Environment; }
10 11
11 namespace sandbox { 12 namespace sandbox {
12 13
13 // Helper class to use the setuid sandbox. This class is to be used both 14 // Helper class to use the setuid sandbox. This class is to be used both
14 // before launching the setuid helper and after being executed through the 15 // before launching the setuid helper and after being executed through the
15 // setuid helper. 16 // setuid helper.
16 // 17 //
17 // A typical use would be: 18 // A typical use would be:
18 // 1. The browser calls SetupLaunchEnvironment() 19 // 1. The browser calls SetupLaunchEnvironment()
19 // 2. The browser launches a renderer through the setuid sandbox. 20 // 2. The browser launches a renderer through the setuid sandbox.
(...skipping 11 matching lines...) Expand all
31 bool ChrootMe(); 32 bool ChrootMe();
32 33
33 // Did we get launched through an up to date setuid binary ? 34 // Did we get launched through an up to date setuid binary ?
34 bool IsSuidSandboxUpToDate() const; 35 bool IsSuidSandboxUpToDate() const;
35 // Did we get launched through the setuid helper ? 36 // Did we get launched through the setuid helper ?
36 bool IsSuidSandboxChild() const; 37 bool IsSuidSandboxChild() const;
37 // Did the setuid helper create a new PID namespace ? 38 // Did the setuid helper create a new PID namespace ?
38 bool IsInNewPIDNamespace() const; 39 bool IsInNewPIDNamespace() const;
39 // Did the setuid helper create a new network namespace ? 40 // Did the setuid helper create a new network namespace ?
40 bool IsInNewNETNamespace() const; 41 bool IsInNewNETNamespace() const;
42 // Are we done and fully sandboxed ?
43 bool IsSandboxed() const;
41 44
42 // Set-up the environment. This should be done prior to launching the setuid 45 // Set-up the environment. This should be done prior to launching the setuid
43 // helper. 46 // helper.
44 void SetupLaunchEnvironment(); 47 void SetupLaunchEnvironment();
45 48
46 private: 49 private:
47 // Holds the environment. Will never be NULL. 50 // Holds the environment. Will never be NULL.
48 base::Environment* env_; 51 base::Environment* env_;
52 bool sandboxed_;
49 DISALLOW_IMPLICIT_CONSTRUCTORS(SetuidSandboxClient); 53 DISALLOW_IMPLICIT_CONSTRUCTORS(SetuidSandboxClient);
50 }; 54 };
51 55
52 } // namespace sandbox 56 } // namespace sandbox
53 57
54 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_ 58 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_
OLDNEW
« no previous file with comments | « content/zygote/zygote_main_linux.cc ('k') | sandbox/linux/suid/client/setuid_sandbox_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698