]> git.ipfire.org Git - thirdparty/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)
committerCole Robinson <crobinso@redhat.com>
Tue, 22 Sep 2015 00:18:05 +0000 (20:18 -0400)
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>
(cherry picked from commit 4ac6ce38d3bc60f45491509ede4fc8437348048c)

src/security/security_selinux.c

index e4ef1e256c2f242a9d9808f43bc632aa9c1e3887..d267d5acd0bd3f5402f21077e0cbaf0d680f8e2f 100644 (file)
@@ -1743,7 +1743,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;
         }