From 520e29596aa6f3429e57ddc34bdeb5e0315fc6e6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Feb 2012 13:44:18 +0000 Subject: 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) --- daemon/daemon.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; \ -- cgit