[lxc-devel] [lxd/master] lxd/seccomp: Fix profile conflict between projects

stgraber on Github lxc-bot at linuxcontainers.org
Mon May 11 17:37:11 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200511/d57d5fba/attachment-0001.bin>
-------------- next part --------------
From 3709620f86bdab0ef20b18355dfa4e73e0fef0cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 11 May 2020 13:34:49 -0400
Subject: [PATCH] lxd/seccomp: Fix profile conflict between projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/seccomp/seccomp.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd/seccomp/seccomp.go b/lxd/seccomp/seccomp.go
index 8a7ddd0a66..0c78860b1a 100644
--- a/lxd/seccomp/seccomp.go
+++ b/lxd/seccomp/seccomp.go
@@ -19,6 +19,7 @@ import (
 	liblxc "gopkg.in/lxc/go-lxc.v2"
 
 	deviceConfig "github.com/lxc/lxd/lxd/device/config"
+	"github.com/lxc/lxd/lxd/project"
 	"github.com/lxc/lxd/lxd/state"
 	"github.com/lxc/lxd/lxd/ucred"
 	"github.com/lxc/lxd/lxd/util"
@@ -378,7 +379,7 @@ var seccompPath = shared.VarPath("security", "seccomp")
 
 // ProfilePath returns the seccomp path for the instance.
 func ProfilePath(c Instance) string {
-	return path.Join(seccompPath, c.Name())
+	return path.Join(seccompPath, project.Instance(c.Project(), c.Name()))
 }
 
 // InstanceNeedsPolicy returns whether the instance needs a policy or not.


More information about the lxc-devel mailing list