[CRIU] [PATCH v2 1/9] lsm: move apparmor securityfs path to constant in lsm.h

Tycho Andersen tycho.andersen at canonical.com
Mon Oct 24 08:51:05 PDT 2016


Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 criu/include/lsm.h | 2 ++
 criu/lsm.c         | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/criu/include/lsm.h b/criu/include/lsm.h
index d3f9610..b97195e 100644
--- a/criu/include/lsm.h
+++ b/criu/include/lsm.h
@@ -4,6 +4,8 @@
 #include "images/inventory.pb-c.h"
 #include "images/creds.pb-c.h"
 
+#define AA_SECURITYFS_PATH "/sys/kernel/security/apparmor"
+
 /*
  * Get the Lsmtype for the current host.
  */
diff --git a/criu/lsm.c b/criu/lsm.c
index 330ffc4..27ca004 100644
--- a/criu/lsm.c
+++ b/criu/lsm.c
@@ -9,6 +9,7 @@
 #include "pstree.h"
 #include "util.h"
 #include "cr_options.h"
+#include "lsm.h"
 
 #include "protobuf.h"
 #include "images/inventory.pb-c.h"
@@ -116,7 +117,7 @@ void kerndat_lsm(void)
 	if (name)
 		return;
 
-	if (access("/sys/kernel/security/apparmor", F_OK) == 0) {
+	if (access(AA_SECURITYFS_PATH, F_OK) == 0) {
 		get_label = apparmor_get_label;
 		lsmtype = LSMTYPE__APPARMOR;
 		name = "apparmor";
-- 
2.9.3



More information about the CRIU mailing list