]> git.ipfire.org Git - thirdparty/systemd.git/blame_incremental - src/core/namespace.h
doc,core: Read{Write,Only}Paths= and InaccessiblePaths=
[thirdparty/systemd.git] / src / core / namespace.h
... / ...
CommitLineData
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2010 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22#include <stdbool.h>
23
24#include "macro.h"
25
26typedef enum ProtectHome {
27 PROTECT_HOME_NO,
28 PROTECT_HOME_YES,
29 PROTECT_HOME_READ_ONLY,
30 _PROTECT_HOME_MAX,
31 _PROTECT_HOME_INVALID = -1
32} ProtectHome;
33
34typedef enum ProtectSystem {
35 PROTECT_SYSTEM_NO,
36 PROTECT_SYSTEM_YES,
37 PROTECT_SYSTEM_FULL,
38 _PROTECT_SYSTEM_MAX,
39 _PROTECT_SYSTEM_INVALID = -1
40} ProtectSystem;
41
42int setup_namespace(const char *chroot,
43 char **read_write_paths,
44 char **read_only_paths,
45 char **inaccessible_paths,
46 const char *tmp_dir,
47 const char *var_tmp_dir,
48 bool private_dev,
49 ProtectHome protect_home,
50 ProtectSystem protect_system,
51 unsigned long mount_flags);
52
53int setup_tmp_dirs(const char *id,
54 char **tmp_dir,
55 char **var_tmp_dir);
56
57int setup_netns(int netns_storage_socket[2]);
58
59const char* protect_home_to_string(ProtectHome p) _const_;
60ProtectHome protect_home_from_string(const char *s) _pure_;
61
62const char* protect_system_to_string(ProtectSystem p) _const_;
63ProtectSystem protect_system_from_string(const char *s) _pure_;