diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-02-13 13:44:18 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-02-13 13:49:21 +0000 |
commit | 07081591cf9928454148db84828da8a7f39b6c6f (patch) | |
tree | c1680811b8fc85f595f6d0b2f528390321f1b50a | |
parent | ba443ae0486ae30ea597c4e126de63371f8fa7a8 (diff) | |
download | libguestfs-07081591cf9928454148db84828da8a7f39b6c6f.tar.gz libguestfs-07081591cf9928454148db84828da8a7f39b6c6f.tar.xz libguestfs-07081591cf9928454148db84828da8a7f39b6c6f.zip |
daemon: Return error properly when user tries to mount appliance root (RHBZ#789960).
In the case where the caller attempts to mount the "hidden"
appliance root device (eg. /dev/vdb if /dev/vda is the only
normal block device added), we were calling reply_with_error
but not actually returning immediately, resulting in protocol
desynchronization.
This commit fixes this obvious mistake.
-rw-r--r-- | daemon/daemon.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h index b518f92d..c92e1108 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -264,8 +264,11 @@ is_zero (const char *buffer, size_t size) reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \ fail_stmt; \ } \ - if (is_root_device (path)) \ + if (is_root_device (path)) { \ + cancel_stmt; \ reply_with_error ("%s: %s: device not found", __func__, path); \ + fail_stmt; \ + } \ if (device_name_translation ((path)) == -1) { \ int err = errno; \ cancel_stmt; \ |