1 | /* Copyright © 2005-2007 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 | #include <config.h> |
---|
20 | |
---|
21 | #include "sbuild-chroot-plain.h" |
---|
22 | #include "sbuild-chroot-facet-session-clonable.h" |
---|
23 | #include "sbuild-format-detail.h" |
---|
24 | #include "sbuild-lock.h" |
---|
25 | |
---|
26 | #include <cerrno> |
---|
27 | |
---|
28 | #include <sys/types.h> |
---|
29 | #include <sys/stat.h> |
---|
30 | #include <sys/sysmacros.h> |
---|
31 | #include <unistd.h> |
---|
32 | |
---|
33 | using namespace sbuild; |
---|
34 | |
---|
35 | chroot_plain::chroot_plain (): |
---|
36 | chroot_directory_base() |
---|
37 | { |
---|
38 | set_run_setup_scripts(false); |
---|
39 | |
---|
40 | remove_facet<chroot_facet_session_clonable>(); |
---|
41 | } |
---|
42 | |
---|
43 | chroot_plain::~chroot_plain () |
---|
44 | { |
---|
45 | } |
---|
46 | |
---|
47 | sbuild::chroot::ptr |
---|
48 | chroot_plain::clone () const |
---|
49 | { |
---|
50 | return ptr(new chroot_plain(*this)); |
---|
51 | } |
---|
52 | |
---|
53 | chroot::ptr |
---|
54 | sbuild::chroot_plain::clone_session (std::string const& session_id, |
---|
55 | std::string const& user, |
---|
56 | bool root) const |
---|
57 | { |
---|
58 | return ptr(); |
---|
59 | } |
---|
60 | |
---|
61 | chroot::ptr |
---|
62 | sbuild::chroot_plain::clone_source () const |
---|
63 | { |
---|
64 | return ptr(); |
---|
65 | } |
---|
66 | |
---|
67 | std::string const& |
---|
68 | chroot_plain::get_chroot_type () const |
---|
69 | { |
---|
70 | static const std::string type("plain"); |
---|
71 | |
---|
72 | return type; |
---|
73 | } |
---|
74 | |
---|
75 | std::string |
---|
76 | chroot_plain::get_path () const |
---|
77 | { |
---|
78 | return get_directory(); |
---|
79 | } |
---|
80 | |
---|
81 | void |
---|
82 | chroot_plain::setup_lock (chroot::setup_type type, |
---|
83 | bool lock, |
---|
84 | int status) |
---|
85 | { |
---|
86 | /* By default, plain chroots do no locking. */ |
---|
87 | } |
---|
88 | |
---|
89 | sbuild::chroot::session_flags |
---|
90 | chroot_plain::get_session_flags (chroot const& chroot) const |
---|
91 | { |
---|
92 | return SESSION_NOFLAGS; |
---|
93 | } |
---|