From: Etienne CHAMPETIER Date: Fri, 30 Dec 2016 02:08:58 +0000 (-0800) Subject: ujail: add basic /dev files X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f7069032290a9720142b2ee2c6315d7e1f1a1bd3;p=project%2Fprocd.git ujail: add basic /dev files 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 --- diff --git a/jail/jail.c b/jail/jail.c index 834d677..8e7cddc 100644 --- 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;