summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libcap
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/libcap')
-rw-r--r--meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch32
-rw-r--r--meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch11
-rw-r--r--meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch30
-rw-r--r--meta/recipes-support/libcap/libcap_2.76.bb (renamed from meta/recipes-support/libcap/libcap_2.69.bb)33
4 files changed, 17 insertions, 89 deletions
diff --git a/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch b/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch
deleted file mode 100644
index 05c771ac10..0000000000
--- a/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Ensure the XATTR_NAME_CAPS is defined when it is used
2
3Upstream-Status: Pending
4
5VFS_CAP_U32 can not ensure that XATTR_NAME_CAPS is defined, and failed to build
6libcap-native in old release, like CentOS release 6.7 (Final), with the blow
7error:
8 cap_file.c: In function ‘cap_get_fd’:
9 cap_file.c:199: error: ‘XATTR_NAME_CAPS’ undeclared (first use in this function)
10 cap_file.c:199: error: (Each undeclared identifier is reported only once
11
12Signed-off-by: Roy Li <rongqing.li@windriver.com>
13---
14 libcap/cap_file.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/libcap/cap_file.c b/libcap/cap_file.c
18index 40756ea..e27ca80 100644
19--- a/libcap/cap_file.c
20+++ b/libcap/cap_file.c
21@@ -25,7 +25,7 @@ extern int fremovexattr(int, const char *);
22
23 #include "libcap.h"
24
25-#ifdef VFS_CAP_U32
26+#if defined (VFS_CAP_U32) && defined (XATTR_NAME_CAPS)
27
28 #if VFS_CAP_U32 != __CAP_BLKS
29 # error VFS representation of capabilities is not the same size as kernel
30--
312.8.1
32
diff --git a/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch b/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch
index 2ac1e6e560..2cec20b4b1 100644
--- a/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch
+++ b/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch
@@ -1,4 +1,4 @@
1From 709aa8e156415215b0bb034d05b2aa2f44be044e Mon Sep 17 00:00:00 2001 1From 969d21aa2bf474d9c5c80a64de1a9fe0e17e31b2 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 14 Oct 2021 15:57:36 +0800 3Date: Thu, 14 Oct 2021 15:57:36 +0800
4Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl 4Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl
@@ -14,18 +14,17 @@ the strings in a certain path.
14Upstream-Status: Inappropriate [SDK specific] 14Upstream-Status: Inappropriate [SDK specific]
15 15
16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
17
18--- 17---
19 libcap/execable.h | 2 +- 18 libcap/execable.h | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-) 19 1 file changed, 1 insertion(+), 1 deletion(-)
21 20
22diff --git a/libcap/execable.h b/libcap/execable.h 21diff --git a/libcap/execable.h b/libcap/execable.h
23index fee17b4..5bb0c55 100644 22index a68ea24..60d3853 100644
24--- a/libcap/execable.h 23--- a/libcap/execable.h
25+++ b/libcap/execable.h 24+++ b/libcap/execable.h
26@@ -23,7 +23,7 @@ 25@@ -34,7 +34,7 @@ extern const int _IO_stdin_used;
27 #endif 26 const int _IO_stdin_used __attribute__((weak)) = 131073;
28 #define __EXECABLE_H 27 #endif /* def __GLIBC__ */
29 28
30-const char __execable_dl_loader[] __attribute((section(".interp"))) = 29-const char __execable_dl_loader[] __attribute((section(".interp"))) =
31+const char __execable_dl_loader[4096] __attribute((section(".interp"))) = 30+const char __execable_dl_loader[4096] __attribute((section(".interp"))) =
diff --git a/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch b/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch
deleted file mode 100644
index 20346cf2fb..0000000000
--- a/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 10212b6d4e8843feffbeab5336342d97f3a46bb2 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 20 Dec 2019 16:54:05 +0100
4Subject: [PATCH] tests: do not run target executables
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8
9---
10 tests/Makefile | 2 --
11 1 file changed, 2 deletions(-)
12
13diff --git a/tests/Makefile b/tests/Makefile
14index ecb7d1b..8950c73 100644
15--- a/tests/Makefile
16+++ b/tests/Makefile
17@@ -61,13 +61,11 @@ endif
18
19 # unprivileged
20 run_psx_test: psx_test
21- ./psx_test
22
23 psx_test: psx_test.c $(DEPS)
24 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB)
25
26 run_libcap_psx_test: libcap_psx_test
27- ./libcap_psx_test
28
29 libcap_psx_test: libcap_psx_test.c $(DEPS)
30 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB)
diff --git a/meta/recipes-support/libcap/libcap_2.69.bb b/meta/recipes-support/libcap/libcap_2.76.bb
index 92fa766d37..c842246fc0 100644
--- a/meta/recipes-support/libcap/libcap_2.69.bb
+++ b/meta/recipes-support/libcap/libcap_2.76.bb
@@ -3,34 +3,30 @@ DESCRIPTION = "A library providing the API to access POSIX capabilities. \
3These allow giving various kinds of specific privileges to individual \ 3These allow giving various kinds of specific privileges to individual \
4users, without giving them full root permissions." 4users, without giving them full root permissions."
5HOMEPAGE = "http://sites.google.com/site/fullycapable/" 5HOMEPAGE = "http://sites.google.com/site/fullycapable/"
6# no specific GPL version required 6
7LICENSE = "BSD-3-Clause | GPL-2.0-only" 7# The library is BSD | GPLv2, the PAM module is BSD | LGPLv2+
8LIC_FILES_CHKSUM_PAM = "file://pam_cap/License;md5=905326f41d3d1f8df21943f9a4ed6b50" 8LICENSE = "(BSD-3-Clause | GPL-2.0-only) & (BSD-3-Clause | LGPL-2.0-or-later)"
9LIC_FILES_CHKSUM = "file://License;md5=2965a646645b72ecee859b43c592dcaa \ 9LIC_FILES_CHKSUM = "file://License;md5=2965a646645b72ecee859b43c592dcaa \
10 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${LIC_FILES_CHKSUM_PAM}', '', d)} \ 10 file://pam_cap/License;md5=905326f41d3d1f8df21943f9a4ed6b50 \
11 " 11 "
12 12
13DEPENDS = "hostperl-runtime-native gperf-native" 13DEPENDS = "hostperl-runtime-native gperf-native"
14 14
15SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ 15SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz"
16 file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \
17 file://0002-tests-do-not-run-target-executables.patch \
18 "
19SRC_URI:append:class-nativesdk = " \ 16SRC_URI:append:class-nativesdk = " \
20 file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ 17 file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
21 " 18 "
22SRC_URI[sha256sum] = "f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb" 19SRC_URI[sha256sum] = "629da4ab29900d0f7fcc36227073743119925fd711c99a1689bbf5c9b40c8e6f"
23 20
24UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" 21UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
25 22
26inherit lib_package 23inherit lib_package
27 24
28PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" 25PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
29PACKAGECONFIG:class-native ??= ""
30
31PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" 26PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
32 27
33EXTRA_OEMAKE = " \ 28EXTRA_OEMAKE = " \
29 ${PACKAGECONFIG_CONFARGS} \
34 INDENT= \ 30 INDENT= \
35 lib='${baselib}' \ 31 lib='${baselib}' \
36 RAISE_SETFCAP=no \ 32 RAISE_SETFCAP=no \
@@ -38,23 +34,16 @@ EXTRA_OEMAKE = " \
38 USE_GPERF=yes \ 34 USE_GPERF=yes \
39" 35"
40 36
41EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
42
43do_compile() { 37do_compile() {
44 unset CFLAGS BUILD_CFLAGS
45 oe_runmake \ 38 oe_runmake \
46 ${PACKAGECONFIG_CONFARGS} \
47 AR="${AR}" \ 39 AR="${AR}" \
48 CC="${CC}" \ 40 CC="${CC}" \
49 RANLIB="${RANLIB}" \ 41 RANLIB="${RANLIB}" \
50 OBJCOPY="${OBJCOPY}" \ 42 OBJCOPY="${OBJCOPY}"
51 COPTS="${CFLAGS}" \
52 BUILD_COPTS="${BUILD_CFLAGS}"
53} 43}
54 44
55do_install() { 45do_install() {
56 oe_runmake install \ 46 oe_runmake install \
57 ${PACKAGECONFIG_CONFARGS} \
58 DESTDIR="${D}" \ 47 DESTDIR="${D}" \
59 prefix="${prefix}" \ 48 prefix="${prefix}" \
60 SBINDIR="${sbindir}" 49 SBINDIR="${sbindir}"
@@ -71,9 +60,11 @@ do_install:append() {
71 fi 60 fi
72} 61}
73 62
74FILES:${PN}-dev += "${base_libdir}/*.so"
75
76# pam files 63# pam files
77FILES:${PN} += "${base_libdir}/security/*.so" 64FILES:${PN} += "${base_libdir}/security/*.so"
78 65
66# The license of the main package depends on whether PAM is enabled or not
67LICENSE:${PN} = "(BSD-3-Clause | GPL-2.0-only)${@bb.utils.contains('PACKAGECONFIG', 'pam', ' & (BSD-3-Clause | LGPL-2.0-or-later)', '', d)}"
68LICENSE:${PN}-dev = "(BSD-3-Clause | GPL-2.0-only)"
69
79BBCLASSEXTEND = "native nativesdk" 70BBCLASSEXTEND = "native nativesdk"