[lxc-devel] [lxd/master] Fix App

monstermunchkin on Github lxc-bot at linuxcontainers.org
Fri Nov 23 14:29:15 UTC 2018


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/20181123/d2d4a8fe/attachment.bin>
-------------- next part --------------
From 57fc5af28fa51c187280fb1aac308ce395762550 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Tue, 16 Oct 2018 15:37:52 +0200
Subject: [PATCH 1/2] test: Support AppArmor policy cache directory

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

diff --git a/test/includes/lxd.sh b/test/includes/lxd.sh
index b3353a2cba..984b90b47d 100644
--- a/test/includes/lxd.sh
+++ b/test/includes/lxd.sh
@@ -201,7 +201,7 @@ kill_lxd() {
         rm -f "${daemon_dir}/containers/lxc-monitord.log"
 
         # Support AppArmor policy cache directory
-        if apparmor_parser --help | grep -q -- --'print-cache.dir'; then
+        if apparmor_parser --help | grep -q -- '--print-cache.dir'; then
           apparmor_cache_dir="$(apparmor_parser -L "${daemon_dir}"/security/apparmor/cache --print-cache-dir)"
         else
           apparmor_cache_dir="${daemon_dir}/security/apparmor/cache"

From 6ea4d2c3d3afa177ae8ee43d5d23423fc0cb6887 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Fri, 16 Nov 2018 18:18:50 +0100
Subject: [PATCH 2/2] lxd: Fix AppArmor cache policy version check

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

diff --git a/lxd/apparmor.go b/lxd/apparmor.go
index 644a203549..8a158beeca 100644
--- a/lxd/apparmor.go
+++ b/lxd/apparmor.go
@@ -440,7 +440,7 @@ func getAACacheDir() string {
 	}
 
 	// multiple policy cache directories were only added in v2.13
-	if major >= 2 && minor <= 12 {
+	if major < 2 || (major == 2 && minor < 13) {
 		return basePath
 	}
 


More information about the lxc-devel mailing list