aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Lucangeli Obes <jorgelo@google.com>2016-03-16 22:41:34 -0700
committerJorge Lucangeli Obes <jorgelo@google.com>2016-03-16 22:49:37 -0700
commit6b0de9b30aec11d4736557bd7fde0c36ea238ada (patch)
tree54bc2a4826b20dab4ce2d36f1be81bc5d15c14a2
parent097b719fafb1add8a1fd60bf6d230816810dd7fa (diff)
downloadminijail-6b0de9b30aec11d4736557bd7fde0c36ea238ada.tar.gz
Fix typo in error message.
I did not notice "unmount(2)" -- the syscall is "umount". While in there, reword the comment to make it clearer. Bug: None Change-Id: I789a5a2c42a4973e8d90e3b61714fc84bd558df6
-rw-r--r--libminijail.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libminijail.c b/libminijail.c
index fc3368a..2927b62 100644
--- a/libminijail.c
+++ b/libminijail.c
@@ -1092,7 +1092,7 @@ int enter_pivot_root(const struct minijail *j)
/*
* Keep the fd for both old and new root.
- * It will be used in fchdir later.
+ * It will be used in fchdir(2) later.
*/
oldroot = open("/", O_DIRECTORY | O_RDONLY | O_CLOEXEC);
if (oldroot < 0)
@@ -1102,7 +1102,7 @@ int enter_pivot_root(const struct minijail *j)
pdie("failed to open %s for fchdir", j->chrootdir);
/*
- * To ensure chrootdir is the root of a file system,
+ * To ensure j->chrootdir is the root of a filesystem,
* do a self bind mount.
*/
if (mount(j->chrootdir, j->chrootdir, "bind", MS_BIND | MS_REC, ""))
@@ -1113,22 +1113,23 @@ int enter_pivot_root(const struct minijail *j)
pdie("pivot_root");
/*
- * Now the old root is mounted on top of the new root. Use fchdir to
+ * Now the old root is mounted on top of the new root. Use fchdir(2) to
* change to the old root and unmount it.
*/
if (fchdir(oldroot))
pdie("failed to fchdir to old /");
/*
- * If j->flags.skip_remount_private is enabled, there could be a shared
- * mount point under |oldroot|. In such a case, mount points under the
- * shared mount point will be unmount(2)'ed below, so that it is
- * propagated to the original mount namespace. To prevent such
- * unexpected unmounting, remove them from peer groups by recursive
- * PRIVATE marking.
+ * If j->flags.skip_remount_private was enabled for minijail_enter(), there
+ * could be a shared mount point under |oldroot|. In that case, mounts
+ * under this shared mount point will be unmounted below, and this
+ * unmounting will propagate to the original mount namespace (because the
+ * mount point is shared). To prevent this unexpected unmounting, remove
+ * these mounts from their peer groups by recursively remounting them as
+ * MS_PRIVATE.
*/
if (mount(NULL, ".", NULL, MS_REC | MS_PRIVATE, NULL))
- pdie("failed to mount(/, private) for unmount(/)");
+ pdie("failed to mount(/, private) before umount(/)");
/* The old root might be busy, so use lazy unmount. */
if (umount2(".", MNT_DETACH))
pdie("umount(/)");