Blob Blame History Raw
From bc80e46dc56255dec477073bf021a7360ba48ce5 Mon Sep 17 00:00:00 2001
Message-Id: <bc80e46dc56255dec477073bf021a7360ba48ce5@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Thu, 12 Jun 2014 10:50:43 +0200
Subject: [PATCH] Fix crash when saving a domain with type none dac label

qemuDomainGetImageIds did not check if there was a label
in the seclabel, thus crashing on
<seclabel type='none' model='dac'/>

https://bugzilla.redhat.com/show_bug.cgi?id=1108590
https://bugzilla.redhat.com/show_bug.cgi?id=1171124
(cherry picked from commit 7eb0ee175b278a4439cee65a7a554767f0be9cd1)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>

Conflicts:
	src/qemu/qemu_domain.c - the call to virParseOwnershipIds is not
        present in 7.0.z
---
 src/qemu/qemu_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1ce4c39..b0d4f33 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2777,6 +2777,7 @@ qemuOpenFile(virQEMUDriverPtr driver,
     /* TODO: Take imagelabel into account? */
     if (vm &&
         (seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
+        seclabel->label != NULL &&
         (virParseOwnershipIds(seclabel->label, &user, &group) < 0))
         goto cleanup;
 
-- 
2.2.0