From 6fb8fbad9fd9055658817774acc769af4839d11c Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Thu, 13 Aug 2015 07:35:10 +0200 Subject: [PATCH] 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 (cherry picked from commit 4ac6ce38d3bc60f45491509ede4fc8437348048c) --- src/security/security_selinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index e4ef1e256c..d267d5acd0 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -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; } -- 2.47.2