summaryrefslogtreecommitdiffstats
path: root/jail
diff options
context:
space:
mode:
Diffstat (limited to 'jail')
-rw-r--r--jail/jail.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/jail/jail.c b/jail/jail.c
index 08d5ee1..3b5587a 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -43,7 +43,7 @@
#include <libubox/uloop.h>
#define STACK_SIZE (1024 * 1024)
-#define OPT_ARGS "P:S:n:r:w:psuld"
+#define OPT_ARGS "P:S:n:r:w:psuldo"
struct extra {
struct list_head list;
@@ -289,6 +289,7 @@ static int spawn_child(void *arg)
char **argv = arg;
int argc = 0, ch;
char *mpoint;
+ int ronly = 0;
while (argv[argc])
argc++;
@@ -305,6 +306,9 @@ static int spawn_child(void *arg)
case 'p':
procfs = 1;
break;
+ case 'o':
+ ronly = 1;
+ break;
case 's':
sysfs = 1;
break;
@@ -331,7 +335,8 @@ static int spawn_child(void *arg)
mkdir("/sys", 0755);
mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
}
- mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
+ if (ronly)
+ mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
uloop_init();