Skip to content

Commit 944f258

Browse files
committedMar 10, 2019
ima-evm-utils: apply upstream fix for attr-2.4.48 compatibility
1 parent a90bfc1 commit 944f258

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
 

‎pkgs/os-specific/linux/ima-evm-utils/default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
1313
nativeBuildInputs = [ autoreconfHook pkgconfig ];
1414
buildInputs = [ openssl attr keyutils asciidoc libxslt ];
1515

16+
patches = [ ./xattr.patch ];
17+
1618
buildPhase = "make prefix=$out MANPAGE_DOCBOOK_XSL=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl";
1719

1820
meta = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
commit 6aea54d2ad2287b3e8894c262ee895f3d4a60516
2+
Author: André Draszik <git@andred.net>
3+
Date: 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+
24+
diff --git a/configure.ac b/configure.ac
25+
index 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
37+
diff --git a/packaging/ima-evm-utils.spec b/packaging/ima-evm-utils.spec
38+
index 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
49+
diff --git a/packaging/ima-evm-utils.spec.in b/packaging/ima-evm-utils.spec.in
50+
index 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
61+
diff --git a/src/evmctl.c b/src/evmctl.c
62+
index 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>

0 commit comments

Comments
 (0)
Please sign in to comment.