summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-02-13 13:44:18 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-02-13 15:44:33 +0000
commit520e29596aa6f3429e57ddc34bdeb5e0315fc6e6 (patch)
tree71d06391fb4627f4d745daac506ab26d2169426b
parent563a801bf788c60f7efa31ebae1a9a005b8bff09 (diff)
downloadlibguestfs-520e29596aa6f3429e57ddc34bdeb5e0315fc6e6.tar.gz
libguestfs-520e29596aa6f3429e57ddc34bdeb5e0315fc6e6.tar.xz
libguestfs-520e29596aa6f3429e57ddc34bdeb5e0315fc6e6.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. (cherry picked from commit 07081591cf9928454148db84828da8a7f39b6c6f)
-rw-r--r--daemon/daemon.h5
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; \