diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-04 15:05:23 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-04 15:06:28 +0100 |
commit | ab81d09a710242ab61001ef5e8ffd321725b47a7 (patch) | |
tree | bf39863d56c2dc1872d9cc76fc95f7da1c94cac1 /daemon/command.c | |
parent | 96b9d82e2f4f24cdd41040f54a7597202c04cf7e (diff) | |
download | libguestfs-ab81d09a710242ab61001ef5e8ffd321725b47a7.tar.gz libguestfs-ab81d09a710242ab61001ef5e8ffd321725b47a7.tar.xz libguestfs-ab81d09a710242ab61001ef5e8ffd321725b47a7.zip |
Fix RHBZ#503169 comment 13 (regression) and add a regression test.
Diffstat (limited to 'daemon/command.c')
-rw-r--r-- | daemon/command.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/daemon/command.c b/daemon/command.c index 1a9bebb6..46a265c9 100644 --- a/daemon/command.c +++ b/daemon/command.c @@ -31,7 +31,7 @@ do_command (char * const * const argv) { char *out, *err; int r; - int proc_ok, dev_ok, sys_ok; + int proc_ok, dev_ok, dev_pts_ok, sys_ok; /* We need a root filesystem mounted to do this. */ NEED_ROOT (NULL); @@ -53,11 +53,13 @@ do_command (char * const * const argv) * We deliberately allow these commands to fail silently, BUT * if a mount fails, don't unmount the corresponding mount. */ - r = command (NULL, NULL, "mount", "--rbind", "/dev", "/sysroot/dev", NULL); + r = command (NULL, NULL, "mount", "--bind", "/dev", "/sysroot/dev", NULL); dev_ok = r != -1; - r = command (NULL, NULL, "mount", "--rbind", "/proc", "/sysroot/proc", NULL); + r = command (NULL, NULL, "mount", "--bind", "/dev/pts", "/sysroot/dev/pts", NULL); + dev_pts_ok = r != -1; + r = command (NULL, NULL, "mount", "--bind", "/proc", "/sysroot/proc", NULL); proc_ok = r != -1; - r = command (NULL, NULL, "mount", "--rbind", "/sys", "/sysroot/sys", NULL); + r = command (NULL, NULL, "mount", "--bind", "/sys", "/sysroot/sys", NULL); sys_ok = r != -1; CHROOT_IN; @@ -66,6 +68,7 @@ do_command (char * const * const argv) if (sys_ok) command (NULL, NULL, "umount", "/sysroot/sys", NULL); if (proc_ok) command (NULL, NULL, "umount", "/sysroot/proc", NULL); + if (dev_pts_ok) command (NULL, NULL, "umount", "/sysroot/dev/pts", NULL); if (dev_ok) command (NULL, NULL, "umount", "/sysroot/dev", NULL); if (r == -1) { |