diff --git a/0015-libselinux-restorecon-Include-selinux-label.h.patch b/0015-libselinux-restorecon-Include-selinux-label.h.patch new file mode 100644 index 0000000..6550010 --- /dev/null +++ b/0015-libselinux-restorecon-Include-selinux-label.h.patch @@ -0,0 +1,48 @@ +From 92afdbb47859ac019b8a4a6d6a597744582786b3 Mon Sep 17 00:00:00 2001 +From: Vit Mojzis +Date: Fri, 26 Jul 2024 17:59:15 +0200 +Subject: [PATCH] libselinux/restorecon: Include +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +restorecon.h uses types defined in label.h, so it needs to include +label.h (or code using restorecon.h also needs to include label.h, +which is not practical). + +Fixes: + $ make DESTDIR=~/obj install > make.out +In file included from semanage_store.c:39: +/home/sdsmall/obj/usr/include/selinux/restorecon.h:137:52: error: +‘struct selabel_handle’ declared inside parameter list will not be +visible outside of this definition or declaration [-Werror] + 137 | extern void selinux_restorecon_set_sehandle(struct +selabel_handle *hndl); + | ^~~~~~~~~~~~~~ +cc1: all warnings being treated as errors +make[2]: *** [Makefile:111: semanage_store.o] Error 1 +make[1]: *** [Makefile:15: install] Error 2 +make: *** [Makefile:40: install] Error 1 + +Signed-off-by: Vit Mojzis +Acked-by: Stephen Smalley +--- + libselinux/include/selinux/restorecon.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libselinux/include/selinux/restorecon.h b/libselinux/include/selinux/restorecon.h +index 595e7728..faa84eb2 100644 +--- a/libselinux/include/selinux/restorecon.h ++++ b/libselinux/include/selinux/restorecon.h +@@ -1,6 +1,8 @@ + #ifndef _RESTORECON_H_ + #define _RESTORECON_H_ + ++#include ++ + #include + #include + +-- +2.43.0 + diff --git a/libselinux.spec b/libselinux.spec index deee396..3aedcea 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -6,7 +6,7 @@ %endif %define libsepolver 2.9-1 -%define libselinuxrelease 8 +%define libselinuxrelease 9 Summary: SELinux library and simple utilities Name: libselinux @@ -33,6 +33,7 @@ Patch0011: 0011-selinux-8-5-Describe-fcontext-regular-expressions.patch Patch0012: 0012-libselinux-Strip-spaces-before-values-in-config.patch Patch0013: 0013-libselinux-Ignore-missing-directories-when-i-is-used.patch Patch0014: 0014-libselinux-restorecon-Fix-memory-leak-xattr_value.patch +Patch0015: 0015-libselinux-restorecon-Include-selinux-label.h.patch BuildRequires: gcc %if 0%{?with_ruby} @@ -280,6 +281,9 @@ rm -f %{buildroot}%{_mandir}/man8/togglesebool* %endif %changelog +* Mon Jul 29 2024 Vit Mojzis - 2.9-9 +- restorecon: Include (RHEL-50830) + * Wed Dec 07 2022 Vit Mojzis - 2.9-8 - restorecon: Fix memory leak - xattr_value (#2137965)