[lxc-devel] [lxd/master] lxd/apparmor: Fix devPaths in QEMU profile

monstermunchkin on Github lxc-bot at linuxcontainers.org
Thu Oct 8 13:12:32 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201008/2cb15bb9/attachment.bin>
-------------- next part --------------
From 9165a2c1baacd875522cab545fbe70257a18b371 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Thu, 8 Oct 2020 15:11:57 +0200
Subject: [PATCH] lxd/apparmor: Fix devPaths in QEMU profile

Use the devPaths instead of inst.DevPaths(), as the former evaluates
symlinks.

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 lxd/apparmor/instance.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/apparmor/instance.go b/lxd/apparmor/instance.go
index 77d266befd..6fd1a2a11e 100644
--- a/lxd/apparmor/instance.go
+++ b/lxd/apparmor/instance.go
@@ -176,7 +176,7 @@ func instanceProfile(state *state.State, inst instance) (string, error) {
 		}
 
 		err = qemuProfileTpl.Execute(sb, map[string]interface{}{
-			"devPaths":    inst.DevPaths(),
+			"devPaths":    devPaths,
 			"exePath":     util.GetExecPath(),
 			"libraryPath": strings.Split(os.Getenv("LD_LIBRARY_PATH"), ":"),
 			"logPath":     inst.LogPath(),


More information about the lxc-devel mailing list