blob: ffa65dfb00a155feefebc8a5049895f2f0541cb6 [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001From 2dec9199f8a8a2c84b25a3d3e7e2f41b71e07834 Mon Sep 17 00:00:00 2001
2From: Patrick Ohly <patrick.ohly@intel.com>
3Date: Wed, 17 Jun 2015 14:28:18 +0200
4Subject: [PATCH 20/20] evmctl.c: do not depend on xattr.h with IMA defines
5
6Compilation on older Linux distros (like Ubuntu 12.04) fails
7because linux/xattr.h does not yet have the IMA defines. Compiling
8there makes sense when only the tools are needed, for example when
9signing an image in cross-compile mode.
10
11To support this, add fallbacks for the two defines which are needed.
12Their value is part of the Linux ABI and thus fixed.
13
14Upstream-status: Submitted [linux-ima-devel@lists.sourceforge.net]
15
16Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
17
18---
19 src/evmctl.c | 12 ++++++++++++
20 1 file changed, 12 insertions(+)
21
22diff --git a/src/evmctl.c b/src/evmctl.c
23index c54efbb..23cf54c 100644
24--- a/src/evmctl.c
25+++ b/src/evmctl.c
Brad Bishop26bdd442019-08-16 17:08:17 -040026@@ -57,6 +57,18 @@
Brad Bishop15ae2502019-06-18 21:44:24 -040027 #include <termios.h>
Brad Bishop26bdd442019-08-16 17:08:17 -040028 #include <assert.h>
Brad Bishop15ae2502019-06-18 21:44:24 -040029
30+/*
31+ * linux/xattr.h might be old to have this. Allow compilation on older
32+ * Linux distros (like Ubuntu 12.04) by falling back to our own
33+ * definition.
34+ */
35+#ifndef XATTR_IMA_SUFFIX
36+# define XATTR_IMA_SUFFIX "ima"
37+#endif
38+#ifndef XATTR_NAME_IMA
39+# define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
40+#endif
41+
42 #include <openssl/sha.h>
43 #include <openssl/pem.h>
44 #include <openssl/hmac.h>
45--
462.1.4
47