diff options
author | Renato Caldas <renato@calgera.com> | 2023-06-29 15:31:47 +0100 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2023-07-31 15:08:04 -0400 |
commit | 23d8e2d86317170c0a3c155640c71b83329ff726 (patch) | |
tree | 1ac1f9ac5eeb746fc2a1c4dd04955ccf19fa7d86 | |
parent | bd3902cb9351c37d8e348abcd95c83d267c0a106 (diff) | |
download | meta-selinux-23d8e2d86317170c0a3c155640c71b83329ff726.tar.gz |
libselinux: fix compilation with musl
Signed-off-by: Renato Caldas <renato@calgera.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch | 39 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux_3.5.bb | 5 |
2 files changed, 44 insertions, 0 deletions
diff --git a/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch b/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch new file mode 100644 index 0000000..5b37395 --- /dev/null +++ b/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From a822176c6f181d1e6989900dfc58bbdab6d9065a Mon Sep 17 00:00:00 2001 | ||
2 | From: Renato Caldas <renato@calgera.com> | ||
3 | Date: Thu, 29 Jun 2023 13:59:11 +0100 | ||
4 | Subject: [PATCH] libselinux: restore: drop the obsolete LSF transitional API. | ||
5 | |||
6 | The preferred way to enable LSF support on 32 bit systems is to define | ||
7 | _FILE_OFFSET_BITS=64 when building selinux. | ||
8 | |||
9 | Upstream-Status: Submitted [https://github.com/SELinuxProject/selinux/pull/401] | ||
10 | |||
11 | Signed-off-by: Renato Caldas <renato@calgera.com> | ||
12 | --- | ||
13 | libselinux/src/selinux_restorecon.c | 4 ++-- | ||
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c | ||
17 | index 7ef2d45d..2ff920b0 100644 | ||
18 | --- a/src/selinux_restorecon.c | ||
19 | +++ b/src/selinux_restorecon.c | ||
20 | @@ -437,7 +437,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, | ||
21 | file_spec_t *prevfl, *fl; | ||
22 | uint32_t h; | ||
23 | int ret; | ||
24 | - struct stat64 sb; | ||
25 | + struct stat sb; | ||
26 | |||
27 | __pthread_mutex_lock(&fl_mutex); | ||
28 | |||
29 | @@ -451,7 +451,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, | ||
30 | for (prevfl = &fl_head[h], fl = fl_head[h].next; fl; | ||
31 | prevfl = fl, fl = fl->next) { | ||
32 | if (ino == fl->ino) { | ||
33 | - ret = lstat64(fl->file, &sb); | ||
34 | + ret = lstat(fl->file, &sb); | ||
35 | if (ret < 0 || sb.st_ino != ino) { | ||
36 | freecon(fl->con); | ||
37 | free(fl->file); | ||
38 | -- | ||
39 | 2.41.0 | ||
diff --git a/recipes-security/selinux/libselinux_3.5.bb b/recipes-security/selinux/libselinux_3.5.bb index 8009d6d..37383eb 100644 --- a/recipes-security/selinux/libselinux_3.5.bb +++ b/recipes-security/selinux/libselinux_3.5.bb | |||
@@ -10,6 +10,11 @@ require selinux_common.inc | |||
10 | 10 | ||
11 | inherit lib_package pkgconfig | 11 | inherit lib_package pkgconfig |
12 | 12 | ||
13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" | ||
14 | SRC_URI += "\ | ||
15 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ | ||
16 | " | ||
17 | |||
13 | DEPENDS = "libsepol libpcre2" | 18 | DEPENDS = "libsepol libpcre2" |
14 | DEPENDS:append:libc-musl = " fts" | 19 | DEPENDS:append:libc-musl = " fts" |
15 | 20 | ||