minijail0: unbreak chroot and marshalling
1) Parse opts for chroot and bind
2) Serialize/deserialize chroot properly
BUG=chromium-os:21665
TEST=security_Minijail0
Change-Id: Ic99a40718a9c3ff72561f518179155fb502eef96
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10507
Reviewed-by: Will Drewry <wad@chromium.org>
diff --git a/minijail0.c b/minijail0.c
index f13dd20..5ef57fb 100644
--- a/minijail0.c
+++ b/minijail0.c
@@ -72,8 +72,10 @@
printf("Usage: %s [-Ghprsv] [-b <src>,<dest>[,<writeable>]] [-c <caps>] "
"[-C <dir>] [-g <group>] [-S <file>] [-u <user>] <program> "
"[args...]\n"
- " -b: binds <src> to <dest> in chroot. Multiple instances allowed\n"
+ " -b: binds <src> to <dest> in chroot. Multiple "
+ "instances allowed\n"
" -c <caps>: restrict caps to <caps>\n"
+ " -C <dir>: chroot to <dir>\n"
" -G: inherit secondary groups from uid\n"
" -g <group>: change gid to <group>\n"
" -h: help (this message)\n"
@@ -102,7 +104,7 @@
struct minijail *j = minijail_new();
int opt;
- while ((opt = getopt(argc, argv, "u:g:sS:c:vrGhHp")) != -1) {
+ while ((opt = getopt(argc, argv, "u:g:sS:c:C:b:vrGhHp")) != -1) {
switch (opt) {
case 'u':
set_user(j, optarg);