/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
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
(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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdlib.h>
#include <unistd.h>
#include "log.h"
#include "namespace.h"
const char * const writable[] = {
"/home",
};
const char * const readonly[] = {
"/",
"/usr",
"/boot",
};
const char *inaccessible[] = {
};
char *root_directory;
char *projects_directory;
int r;
if (projects_directory)
if (root_directory)
else
log_info("Not chrooted");
(char **) writable,
(char **) readonly,
(char **) inaccessible,
NULL,
true,
0);
if (r < 0) {
log_error_errno(r, "Failed to setup namespace: %m");
log_info("Usage:\n"
" sudo TEST_NS_CHROOT=/home/alban/debian-tree TEST_NS_PROJECTS=/home/alban/debian-tree/home/alban/Documents ./test-ns");
return 1;
}
return 1;
}