diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2020-01-20 13:42:23 +0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2020-01-28 10:02:21 -0800 |
commit | 4f65c58251dbfd3070b5ae531c3fa740dde7c335 (patch) | |
tree | 3e657412002fd8668c42059a4afcfc0e7290b62f | |
parent | 197d3588b6748443d5a037e56e53bbcdeb871772 (diff) | |
download | meta-security-4f65c58251dbfd3070b5ae531c3fa740dde7c335.tar.gz |
samhain: fix build with new version attr
The attr/xattr.h has been removed from attr 2.4.48 with commit:
http://git.savannah.nongnu.org/cgit/attr.git/commit/include?id=7921157890d07858d092f4003ca4c6bae9fd2c38
The xattr syscalls are provided by sys/xattr.h from glibc now.
Remove the checking code to adapt it otherwise it would fail to build
with selinux support.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | recipes-ids/samhain/files/fix-build-with-new-version-attr.patch | 73 | ||||
-rw-r--r-- | recipes-ids/samhain/samhain.inc | 1 |
2 files changed, 74 insertions, 0 deletions
diff --git a/recipes-ids/samhain/files/fix-build-with-new-version-attr.patch b/recipes-ids/samhain/files/fix-build-with-new-version-attr.patch new file mode 100644 index 0000000..eaf30db --- /dev/null +++ b/recipes-ids/samhain/files/fix-build-with-new-version-attr.patch | |||
@@ -0,0 +1,73 @@ | |||
1 | From e67acafa62f71f0015ed548918b98ed0b1ded128 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Sun, 19 Jan 2020 15:53:48 +0800 | ||
4 | Subject: [PATCH] fix build with new version attr | ||
5 | |||
6 | The attr/xattr.h has been removed from attr 2.4.48 with commit: | ||
7 | http://git.savannah.nongnu.org/cgit/attr.git/commit/include?id=7921157890d07858d092f4003ca4c6bae9fd2c38 | ||
8 | The xattr syscalls are provided by sys/xattr.h from glibc now. | ||
9 | Remove the checking code to adapt it. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
14 | --- | ||
15 | aclocal.m4 | 26 +++++++++++--------------- | ||
16 | src/sh_unix.c | 2 +- | ||
17 | 2 files changed, 12 insertions(+), 16 deletions(-) | ||
18 | |||
19 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
20 | index ee5b204..38cef8e 100644 | ||
21 | --- a/aclocal.m4 | ||
22 | +++ b/aclocal.m4 | ||
23 | @@ -1453,23 +1453,19 @@ AC_DEFUN([sh_CHECK_POSIX_ACL], | ||
24 | |||
25 | AC_DEFUN([sh_CHECK_XATTR], | ||
26 | [ | ||
27 | - AC_CHECK_HEADERS(attr/xattr.h) | ||
28 | - if test $ac_cv_header_attr_xattr_h = yes; then | ||
29 | - | ||
30 | - AC_CHECK_LIB([attr], [getxattr], sh_lattr=yes, sh_lattr=no) | ||
31 | - if test x"$sh_lattr" = xyes; then | ||
32 | - LIBATTR=-lattr | ||
33 | - else | ||
34 | - LIBATTR= | ||
35 | - fi | ||
36 | - | ||
37 | - OLDLIBS="$LIBS" | ||
38 | - LIBS="$LIBS $LIBATTR" | ||
39 | - AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr], | ||
40 | - [sh_fattr=yes],[sh_fattr=no]) | ||
41 | - LIBS="$OLDLIBS" | ||
42 | + AC_CHECK_LIB([attr], [getxattr], sh_lattr=yes, sh_lattr=no) | ||
43 | + if test x"$sh_lattr" = xyes; then | ||
44 | + LIBATTR=-lattr | ||
45 | + else | ||
46 | + LIBATTR= | ||
47 | fi | ||
48 | |||
49 | + OLDLIBS="$LIBS" | ||
50 | + LIBS="$LIBS $LIBATTR" | ||
51 | + AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr], | ||
52 | + [sh_fattr=yes],[sh_fattr=no]) | ||
53 | + LIBS="$OLDLIBS" | ||
54 | + | ||
55 | if test x"$sh_fattr" = xyes; then | ||
56 | AC_DEFINE(USE_XATTR, 1, [Define if you want extended attributes support.]) | ||
57 | LIBS="$LIBS $LIBATTR" | ||
58 | diff --git a/src/sh_unix.c b/src/sh_unix.c | ||
59 | index 3ede57f..ef236e9 100644 | ||
60 | --- a/src/sh_unix.c | ||
61 | +++ b/src/sh_unix.c | ||
62 | @@ -3681,7 +3681,7 @@ static char * sh_unix_getinfo_acl (char * path, int fd, struct stat * buf) | ||
63 | |||
64 | #ifdef USE_XATTR | ||
65 | |||
66 | -#include <attr/xattr.h> | ||
67 | +#include <sys/xattr.h> | ||
68 | static char * sh_unix_getinfo_xattr_int (char * path, int fd, char * name) | ||
69 | { | ||
70 | char * out = NULL; | ||
71 | -- | ||
72 | 2.7.4 | ||
73 | |||
diff --git a/recipes-ids/samhain/samhain.inc b/recipes-ids/samhain/samhain.inc index 16222ba..91eb697 100644 --- a/recipes-ids/samhain/samhain.inc +++ b/recipes-ids/samhain/samhain.inc | |||
@@ -14,6 +14,7 @@ SRC_URI = "http://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \ | |||
14 | file://samhain-configure-add-option-for-ps.patch \ | 14 | file://samhain-configure-add-option-for-ps.patch \ |
15 | file://samhain-avoid-searching-host-for-postgresql.patch \ | 15 | file://samhain-avoid-searching-host-for-postgresql.patch \ |
16 | file://samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch \ | 16 | file://samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch \ |
17 | file://fix-build-with-new-version-attr.patch \ | ||
17 | file://${INITSCRIPT_NAME}.init \ | 18 | file://${INITSCRIPT_NAME}.init \ |
18 | file://${INITSCRIPT_NAME}.default \ | 19 | file://${INITSCRIPT_NAME}.default \ |
19 | file://samhain.service \ | 20 | file://samhain.service \ |