sbuild  1.7.1
unshare.h
1 /* Copyright © 2005-2013 Roger Leigh <rleigh@debian.org>
2  *
3  * schroot is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * schroot is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_CHROOT_FACET_UNSHARE_H
20 #define SBUILD_CHROOT_FACET_UNSHARE_H
21 
22 #include <sbuild/chroot/facet/facet.h>
23 
24 namespace sbuild
25 {
26  namespace chroot
27  {
28  namespace facet
29  {
30 
34  class unshare : public facet
35  {
36  public:
38  typedef std::shared_ptr<unshare> ptr;
39 
41  typedef std::shared_ptr<const unshare> const_ptr;
42 
45  {
47  };
48 
51 
52  private:
54  unshare ();
55 
56  public:
58  virtual ~unshare ();
59 
65  static ptr
66  create ();
67 
68  virtual facet::ptr
69  clone () const;
70 
71  virtual std::string const&
72  get_name () const;
73 
79  bool
80  get_unshare_net () const;
81 
87  void
88  set_unshare_net (bool unshare);
89 
95  bool
96  get_unshare_sysvipc () const;
97 
103  void
105 
111  bool
112  get_unshare_sysvsem () const;
113 
119  void
121 
127  bool
128  get_unshare_uts () const;
129 
135  void
136  set_unshare_uts (bool unshare);
137 
141  void
142  do_unshare () const;
143 
144  virtual void
145  setup_env (environment& env) const;
146 
147  virtual void
148  get_details (format_detail& detail) const;
149 
150  virtual void
151  get_used_keys (string_list& used_keys) const;
152 
153  virtual void
154  get_keyfile (keyfile& keyfile) const;
155 
156  virtual void
157  set_keyfile (const keyfile& keyfile);
158 
159  private:
168  };
169 
170  }
171  }
172 }
173 
174 #endif /* SBUILD_CHROOT_FACET_UNSHARE_H */
175 
176 /*
177  * Local Variables:
178  * mode:C++
179  * End:
180  */