[valgrind] fixup selinux file context when doing a scl build

Mark Wielaard mjw at fedoraproject.org
Thu Apr 18 18:05:48 UTC 2013


commit 49a8938c40eb9b06878f647a7db80fac54c95338
Author: Mark Wielaard <mjw at redhat.com>
Date:   Thu Apr 18 17:02:07 2013 +0200

    fixup selinux file context when doing a scl build

 valgrind.spec |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/valgrind.spec b/valgrind.spec
index 3baf693..80ed74d 100644
--- a/valgrind.spec
+++ b/valgrind.spec
@@ -183,6 +183,9 @@ BuildRequires: /bin/ps
 
 %{?scl:Requires:%scl_runtime}
 
+# We need to fixup selinux file context when doing a scl build.
+%{?scl:Requires(post): /usr/sbin/semanage, /sbin/restorecon}
+
 ExclusiveArch: %{ix86} x86_64 ppc ppc64 s390x %{arm}
 %ifarch %{ix86}
 %define valarch x86
@@ -453,6 +456,15 @@ echo ===============END TESTING===============
 %{_libdir}/valgrind/libmpiwrap*.so
 %endif
 
+%post
+# Fixup selinux file context inside software collection
+%if 0%{?rhel} == 5
+%{?scl:/usr/sbin/semanage fcontext -a -t unconfined_execmem_exec_t %{_bindir}/valgrind}
+%else
+%{?scl:/usr/sbin/semanage fcontext -a -t execmem_exec_t %{_bindir}/valgrind}
+%endif
+%{?scl:/sbin/restorecon %{_bindir}/valgrind}
+
 %changelog
 * Tue Apr 02 2013 Mark Wielaard <mjw at redhat.com> 3.8.1-13
 - Fix quoting in valgrind valgrind-3.8.1-enable-armv5.patch and


More information about the scm-commits mailing list