drewry@google.com | bd940e9 | 2009-12-07 19:13:27 +0000 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | // Some portions Copyright (c) 2009 The Chromium Authors. |
| 5 | // |
| 6 | // Implements a simple jail that uses CommandLine heavily instead of |
| 7 | // the Options class. It should act as a simple reference implementation |
| 8 | // for all functionality. |
| 9 | |
| 10 | #ifndef __CHROMEOS_MINIJAIL_MINIJAIL_H |
| 11 | #define __CHROMEOS_MINIJAIL_MINIJAIL_H |
| 12 | |
| 13 | #include <string> |
| 14 | |
| 15 | #include <base/basictypes.h> |
| 16 | #include <base/logging.h> |
| 17 | #include <base/scoped_ptr.h> |
| 18 | |
| 19 | #include "minijail/env.h" |
| 20 | #include "minijail/options.h" |
| 21 | #include "minijail/interface.h" |
| 22 | |
| 23 | namespace chromeos { |
| 24 | |
| 25 | |
| 26 | class MiniJailOptions : public minijail::Options { |
| 27 | public: |
| 28 | MiniJailOptions() { } |
| 29 | ~MiniJailOptions() { } |
| 30 | // We can set some defaults here if desired. |
| 31 | private: |
| 32 | DISALLOW_COPY_AND_ASSIGN(MiniJailOptions); |
| 33 | }; |
| 34 | |
| 35 | class MiniJail : public minijail::Interface { |
| 36 | public: |
| 37 | MiniJail() { } |
| 38 | ~MiniJail() { } |
Will Drewry | 8e7799c | 2009-12-07 15:50:16 -0800 | [diff] [blame] | 39 | const char *name() { return "MiniJail"; } |
drewry@google.com | bd940e9 | 2009-12-07 19:13:27 +0000 | [diff] [blame] | 40 | bool Jail() const; |
| 41 | private: |
| 42 | DISALLOW_COPY_AND_ASSIGN(MiniJail); |
| 43 | }; |
| 44 | |
| 45 | } // namespace chromeos |
| 46 | |
| 47 | #endif // __CHROMEOS_MINIJAIL_MINIJAIL |