diff options
author | Jorge Lucangeli Obes <jorgelo@google.com> | 2016-03-08 11:20:03 -0800 |
---|---|---|
committer | Jorge Lucangeli Obes <jorgelo@google.com> | 2016-03-08 11:30:24 -0800 |
commit | 87bf01da8a4f60cd9064ad3b5c34200b2211152a (patch) | |
tree | d034b30f651bbd44252d368347851f00f1d93196 | |
parent | 3da4031a852b9dcfd35b48bc700ad7ae55baa1bc (diff) | |
download | minijail-87bf01da8a4f60cd9064ad3b5c34200b2211152a.tar.gz |
Re-organize flags in 'minijail_preexec'.
This matches the order in 'minijail_preenter'.
Bug: 27304928
Change-Id: I99b421cb19ddf45f73f47748f81e1a09f8e40c48
-rw-r--r-- | libminijail.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libminijail.c b/libminijail.c index b5b041e..be6da23 100644 --- a/libminijail.c +++ b/libminijail.c @@ -166,9 +166,9 @@ void minijail_preexec(struct minijail *j) { int vfs = j->flags.vfs; int enter_vfs = j->flags.enter_vfs; + int skip_remount_private = j->flags.skip_remount_private; int remount_proc_ro = j->flags.remount_proc_ro; int userns = j->flags.userns; - int skip_remount_private = j->flags.skip_remount_private; if (j->user) free(j->user); j->user = NULL; @@ -179,9 +179,9 @@ void minijail_preexec(struct minijail *j) /* Now restore anything we meant to keep. */ j->flags.vfs = vfs; j->flags.enter_vfs = enter_vfs; + j->flags.skip_remount_private = skip_remount_private; j->flags.remount_proc_ro = remount_proc_ro; j->flags.userns = userns; - j->flags.skip_remount_private = skip_remount_private; /* Note, |pids| will already have been used before this call. */ } @@ -282,7 +282,8 @@ int API minijail_change_user(struct minijail *j, const char *user) /* * We're safe to free the buffer here. The strings inside |pw| point * inside |buf|, but we don't use any of them; this leaves the pointers - * dangling but it's safe. |ppw| points at |pw| if getpwnam_r(3) succeeded. + * dangling but it's safe. |ppw| points at |pw| if getpwnam_r(3) + * succeeded. */ free(buf); /* getpwnam_r(3) does *not* set errno when |ppw| is NULL. */ |