From 67d0c6eb9410d5101f4820a7286deacb6398afde Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 3 Jul 2009 10:29:09 +0000 Subject: [PATCH] Skip labelling if no src path present Fixes startup of guest's with sourceless cdrom devices. Patch from Cole Robinson originally posted here: https://bugzilla.redhat.com/499569 but never sent upstream. Signed-off-by: Mark McLoughlin --- ChangeLog | 7 +++++++ src/security_selinux.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0de7884ec3..cb1715426b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jul 3 11:27:14 GMT 2009 Mark McLoughlin + + Patch from Cole Robinson in https://bugzilla.redhat.com/499569 + + * src/security_selinux.c: Skip labelling if no src path + present + Thu Jul 3 11:26:04 GMT 2009 Mark McLoughlin Patch from Tim Waugh in https://bugzilla.redhat.com/507555 diff --git a/src/security_selinux.c b/src/security_selinux.c index 174dd57b72..80c1c855b9 100644 --- a/src/security_selinux.c +++ b/src/security_selinux.c @@ -380,6 +380,9 @@ SELinuxSetSecurityImageLabel(virConnectPtr conn, { const virSecurityLabelDefPtr secdef = &vm->def->seclabel; + if (!disk->src) + return 0; + if (disk->shared) { return SELinuxSetFilecon(conn, disk->src, default_image_context); } else if (disk->readonly) {