projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f800ecf
)
ujail: add basic /dev files
author
Etienne CHAMPETIER
<champetier.etienne@gmail.com>
Fri, 30 Dec 2016 02:08:58 +0000
(18:08 -0800)
committer
John Crispin
<john@phrozen.org>
Tue, 10 Jan 2017 08:23:35 +0000
(09:23 +0100)
This adds
/dev/full
/dev/null
/dev/urandom
/dev/zero
in every jail (not having them only allow subtle bugs)
Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
jail/jail.c
patch
|
blob
|
history
diff --git
a/jail/jail.c
b/jail/jail.c
index 834d67771d4606427254afd88068b3cc9ed78583..8e7cddc997448410ce05fcddde0fe7472596016e 100644
(file)
--- a/
jail/jail.c
+++ b/
jail/jail.c
@@
-398,6
+398,11
@@
int main(int argc, char **argv)
uloop_init();
if (opts.namespace) {
+ add_mount("/dev/full", 0, -1);
+ add_mount("/dev/null", 0, -1);
+ add_mount("/dev/urandom", 0, -1);
+ add_mount("/dev/zero", 0, -1);
+
int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | SIGCHLD;
if (opts.hostname)
flags |= CLONE_NEWUTS;