summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-03-27 02:27:16 +0100
committerJohn Crispin <blogic@openwrt.org>2015-03-27 02:27:16 +0100
commit74d835463e05e5761f6f5271e487f299f29d3f07 (patch)
tree8aa9c0f626470b25b4564ba28dacec46d796e86d
parente5331be64992e865cc7da0ccca8814d494930762 (diff)
downloadunitd-74d835463e05e5761f6f5271e487f299f29d3f07.tar
unitd-74d835463e05e5761f6f5271e487f299f29d3f07.zip
make it optional to remount the tmpfs as ro
Signed-off-by: John Crispin <blogic@openwrt.org>
-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();