at 22.05-pre 73 lines 2.7 kB view raw
1commit 6aea54d2ad2287b3e8894c262ee895f3d4a60516 2Author: André Draszik <git@andred.net> 3Date: Mon Oct 17 12:45:32 2016 +0100 4 5 evmctl: use correct include for xattr.h 6 7 The xattr API/ABI is provided by both the c-library, as well as by the 8 libattr package. The c-library's header file is sys/xattr.h, whereas 9 libattr's header file can be found in attr/xattr.h. 10 11 Given none of the code here *links* against the libattr.so shared library, it 12 is wrong to *compile* against libattr's API (header file). 13 14 Doing so avoids confusion as to which xattr.h is used as the least problem, 15 and potential ABI differences as the worst problem due the mismatching header 16 file used. 17 18 So make sure we compile and link against the same thing, the c-library in 19 both cases. 20 21 Signed-off-by: André Draszik <git@andred.net> 22 Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com> 23 24diff --git a/configure.ac b/configure.ac 25index 0497eb7..a5b4288 100644 26--- a/configure.ac 27+++ b/configure.ac 28@@ -30,7 +30,7 @@ AC_SUBST(OPENSSL_LIBS) 29 AC_CHECK_HEADER(unistd.h) 30 AC_CHECK_HEADERS(openssl/conf.h) 31 32-AC_CHECK_HEADERS(attr/xattr.h, , [AC_MSG_ERROR([attr/xattr.h header not found. You need the libattr development package.])]) 33+AC_CHECK_HEADERS(sys/xattr.h, , [AC_MSG_ERROR([sys/xattr.h header not found. You need the c-library development package.])]) 34 AC_CHECK_HEADERS(keyutils.h, , [AC_MSG_ERROR([keyutils.h header not found. You need the libkeyutils development package.])]) 35 36 #debug support - yes for a while 37diff --git a/packaging/ima-evm-utils.spec b/packaging/ima-evm-utils.spec 38index a11a27a..63388d2 100644 39--- a/packaging/ima-evm-utils.spec 40+++ b/packaging/ima-evm-utils.spec 41@@ -11,7 +11,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 42 BuildRequires: autoconf 43 BuildRequires: automake 44 BuildRequires: openssl-devel 45-BuildRequires: libattr-devel 46 BuildRequires: keyutils-libs-devel 47 48 %description 49diff --git a/packaging/ima-evm-utils.spec.in b/packaging/ima-evm-utils.spec.in 50index 7ca6c6f..65c32f9 100644 51--- a/packaging/ima-evm-utils.spec.in 52+++ b/packaging/ima-evm-utils.spec.in 53@@ -11,7 +11,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 54 BuildRequires: autoconf 55 BuildRequires: automake 56 BuildRequires: openssl-devel 57-BuildRequires: libattr-devel 58 BuildRequires: keyutils-libs-devel 59 60 %description 61diff --git a/src/evmctl.c b/src/evmctl.c 62index 2ffee78..3fbcd33 100644 63--- a/src/evmctl.c 64+++ b/src/evmctl.c 65@@ -49,7 +49,7 @@ 66 #include <stdint.h> 67 #include <string.h> 68 #include <dirent.h> 69-#include <attr/xattr.h> 70+#include <sys/xattr.h> 71 #include <linux/xattr.h> 72 #include <getopt.h> 73 #include <keyutils.h>