[libvirt] [PATCH] selinux: Don't mask errors of virSecuritySELinuxGenNewContext

Peter Krempa pkrempa at redhat.com
Wed Apr 24 12:43:39 UTC 2013


virSecuritySELinuxGenNewContext() reports sensible errors but at
virSecuritySELinuxGenSecurityLabel() the error is masked with a
non-specific one.
---
 src/security/security_selinux.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index c620a2e..89d63ab 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -685,13 +685,10 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr,
             }
         }

-        seclabel->label =
-            virSecuritySELinuxGenNewContext(baselabel, mcs, false);
-        if (!seclabel->label)  {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("cannot generate selinux context for %s"), mcs);
+        seclabel->label = virSecuritySELinuxGenNewContext(baselabel, mcs, false);
+        if (!seclabel->label)
             goto cleanup;
-        }
+
         break;

     case VIR_DOMAIN_SECLABEL_NONE:
-- 
1.8.2.1




More information about the libvir-list mailing list