44539d
From bc80e46dc56255dec477073bf021a7360ba48ce5 Mon Sep 17 00:00:00 2001
44539d
Message-Id: <bc80e46dc56255dec477073bf021a7360ba48ce5@dist-git>
44539d
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
44539d
Date: Thu, 12 Jun 2014 10:50:43 +0200
44539d
Subject: [PATCH] Fix crash when saving a domain with type none dac label
44539d
44539d
qemuDomainGetImageIds did not check if there was a label
44539d
in the seclabel, thus crashing on
44539d
<seclabel type='none' model='dac'/>
44539d
44539d
https://bugzilla.redhat.com/show_bug.cgi?id=1108590
44539d
https://bugzilla.redhat.com/show_bug.cgi?id=1171124
44539d
(cherry picked from commit 7eb0ee175b278a4439cee65a7a554767f0be9cd1)
44539d
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
44539d
44539d
Conflicts:
44539d
	src/qemu/qemu_domain.c - the call to virParseOwnershipIds is not
44539d
        present in 7.0.z
44539d
---
44539d
 src/qemu/qemu_driver.c | 1 +
44539d
 1 file changed, 1 insertion(+)
44539d
44539d
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
44539d
index 1ce4c39..b0d4f33 100644
44539d
--- a/src/qemu/qemu_driver.c
44539d
+++ b/src/qemu/qemu_driver.c
44539d
@@ -2777,6 +2777,7 @@ qemuOpenFile(virQEMUDriverPtr driver,
44539d
     /* TODO: Take imagelabel into account? */
44539d
     if (vm &&
44539d
         (seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
44539d
+        seclabel->label != NULL &&
44539d
         (virParseOwnershipIds(seclabel->label, &user, &group) < 0))
44539d
         goto cleanup;
44539d
 
44539d
-- 
44539d
2.2.0
44539d