From: Martin Kletzander Date: Thu, 13 Aug 2015 05:35:10 +0000 (+0200) Subject: security_selinux: Use proper structure to access socket data X-Git-Tag: v1.2.19-rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ac6ce38d3bc60f45491509ede4fc8437348048c;p=thirdparty%2Flibvirt.git security_selinux: Use proper structure to access socket data 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 --- diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 6e67a86cc2..a37f8c140b 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -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; }