2010-08-17 05:33:07 +04:00
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2010-04-22 00:15:06 +04:00
2012-07-18 21:07:51 +04:00
# pragma once
2010-04-22 00:15:06 +04:00
/***
This file is part of systemd .
Copyright 2010 Lennart Poettering
systemd is free software ; you can redistribute it and / or modify it
2012-04-12 02:20:58 +04:00
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation ; either version 2.1 of the License , or
2010-04-22 00:15:06 +04:00
( at your option ) any later version .
systemd is distributed in the hope that it will be useful , but
WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
2012-04-12 02:20:58 +04:00
Lesser General Public License for more details .
2010-04-22 00:15:06 +04:00
2012-04-12 02:20:58 +04:00
You should have received a copy of the GNU Lesser General Public License
2010-04-22 00:15:06 +04:00
along with systemd ; If not , see < http : //www.gnu.org/licenses/>.
* * */
# include <stdbool.h>
2014-06-04 01:41:44 +04:00
# include "macro.h"
2014-06-04 20:07:55 +04:00
typedef enum ProtectHome {
PROTECT_HOME_NO ,
PROTECT_HOME_YES ,
PROTECT_HOME_READ_ONLY ,
_PROTECT_HOME_MAX ,
_PROTECT_HOME_INVALID = - 1
} ProtectHome ;
typedef enum ProtectSystem {
PROTECT_SYSTEM_NO ,
PROTECT_SYSTEM_YES ,
PROTECT_SYSTEM_FULL ,
_PROTECT_SYSTEM_MAX ,
_PROTECT_SYSTEM_INVALID = - 1
} ProtectSystem ;
2014-06-04 01:41:44 +04:00
2015-05-18 13:20:28 +03:00
int setup_namespace ( const char * chroot ,
char * * read_write_dirs ,
2013-03-14 21:12:27 +04:00
char * * read_only_dirs ,
char * * inaccessible_dirs ,
2014-10-17 15:48:55 +04:00
const char * tmp_dir ,
const char * var_tmp_dir ,
const char * endpoint_path ,
2014-01-20 22:54:51 +04:00
bool private_dev ,
2014-06-04 20:07:55 +04:00
ProtectHome protect_home ,
ProtectSystem protect_system ,
2015-01-01 20:40:07 +03:00
unsigned long mount_flags ) ;
2013-11-27 23:23:18 +04:00
int setup_tmp_dirs ( const char * id ,
char * * tmp_dir ,
char * * var_tmp_dir ) ;
int setup_netns ( int netns_storage_socket [ 2 ] ) ;
2014-06-04 01:41:44 +04:00
2014-06-04 20:07:55 +04:00
const char * protect_home_to_string ( ProtectHome p ) _const_ ;
ProtectHome protect_home_from_string ( const char * s ) _pure_ ;
const char * protect_system_to_string ( ProtectSystem p ) _const_ ;
ProtectSystem protect_system_from_string ( const char * s ) _pure_ ;