]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
security_selinux: Use proper structure to access socket data
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 13 Aug 2015 05:35:10 +0000 (07:35 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 24 Aug 2015 09:53:17 +0000 (11:53 +0200)
In virSecuritySELinuxSetSecurityChardevLabel() we are labelling unix
socket path, but accessing another structure of the union.  This does
not pose a problem currently as both paths are at the same offset, but
this should be fixed for the future.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/security/security_selinux.c

index 6e67a86cc27c323468097aff6437808ca3395c40..a37f8c140b072d18aa42875b704fe7f52616a581 100644 (file)
@@ -1740,7 +1740,7 @@ virSecuritySELinuxSetSecurityChardevLabel(virDomainDefPtr def,
 
     case VIR_DOMAIN_CHR_TYPE_UNIX:
         if (!dev_source->data.nix.listen) {
-            if (virSecuritySELinuxSetFilecon(dev_source->data.file.path,
+            if (virSecuritySELinuxSetFilecon(dev_source->data.nix.path,
                                              imagelabel) < 0)
                 goto done;
         }