public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/haveged] f44: Merge rawhide — add SELinux policy module for semaphore creation
@ 2026-06-19  2:22 Jirka Hladky
  0 siblings, 0 replies; only message in thread
From: Jirka Hladky @ 2026-06-19  2:22 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/haveged
Branch : f44
Commit : f57e483d4b191c90cbf11b58222af36a49675d6d
Author : Jirka Hladky <jhladky@redhat.com>
Date   : 2026-06-18T04:48:21+02:00
Stats  : +28/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/haveged/c/f57e483d4b191c90cbf11b58222af36a49675d6d?branch=f44

Log:
Merge rawhide — add SELinux policy module for semaphore creation

---
diff --git a/haveged-semaphore.te b/haveged-semaphore.te
new file mode 100644
index 0000000..c4233c3
--- /dev/null
+++ b/haveged-semaphore.te
@@ -0,0 +1,11 @@
+module haveged-semaphore 1.0;
+
+require {
+    type entropyd_t;
+    type tmpfs_t;
+    class file { create open read write getattr setattr unlink link rename lock map };
+    class dir { write add_name remove_name search getattr };
+}
+
+allow entropyd_t tmpfs_t:file { create open read write getattr setattr unlink link rename lock map };
+allow entropyd_t tmpfs_t:dir { write add_name remove_name search getattr };

diff --git a/haveged.spec b/haveged.spec
index a5220a9..0d2f946 100644
--- a/haveged.spec
+++ b/haveged.spec
@@ -7,12 +7,14 @@ Release:        2%{?dist}
 License:        GPL-3.0-or-later
 URL:            https://github.com/jirka-h/haveged
 Source0:        https://github.com/jirka-h/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
-Requires(post):   systemd
+Source1:        haveged-semaphore.te
+Requires(post):   systemd policycoreutils
 Requires(preun):  systemd
-Requires(postun): systemd
+Requires(postun): systemd policycoreutils
 
 BuildRequires:  gcc
 BuildRequires:  make automake coreutils glibc-common systemd-units
+BuildRequires:  checkpolicy selinux-policy-devel
 Enhances:       apache2 gpg2 openssl openvpn php5 smtp_daemon systemd
 
 %description
@@ -49,6 +51,10 @@ Headers and shared object symbolic links for the HAVEGE algorithm
 #make %{?_smp_mflags}
 make
 
+# Build SELinux policy module
+cp %{SOURCE1} .
+make -f /usr/share/selinux/devel/Makefile haveged-semaphore.pp
+
 %check
 make check
 
@@ -72,11 +78,15 @@ install -Dpm 0644 contrib/Fedora/90-haveged.rules %{buildroot}%{_udevrulesdir}/9
 # We don't ship .la files.
 rm -rf %{buildroot}%{_libdir}/libhavege.*a
 
+# Install SELinux policy module
+install -Dpm 0644 haveged-semaphore.pp %{buildroot}%{_datadir}/selinux/packages/haveged-semaphore.pp
+
 mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
 cp -p COPYING README ChangeLog AUTHORS contrib/build/havege_sample.c %{buildroot}%{_defaultdocdir}/%{name}
 
 %post
 /sbin/ldconfig
+semodule -i %{_datadir}/selinux/packages/haveged-semaphore.pp 2>/dev/null || :
 %systemd_post %{name}.service %{name}-switch-root.service
 
 %preun
@@ -85,6 +95,9 @@ cp -p COPYING README ChangeLog AUTHORS contrib/build/havege_sample.c %{buildroot
 %postun
 %systemd_postun_with_restart %{name}.service %{name}-switch-root.service
 /sbin/ldconfig
+if [ $1 -eq 0 ]; then
+    semodule -r haveged-semaphore 2>/dev/null || :
+fi
 
 %files
 %{_mandir}/man8/haveged.8*
@@ -95,6 +108,7 @@ cp -p COPYING README ChangeLog AUTHORS contrib/build/havege_sample.c %{buildroot
 %{_udevrulesdir}/*-%{name}.rules
 %dir %{_prefix}/%{dracutlibdir}/modules.d/98%{name}
 %{_prefix}/%{dracutlibdir}/modules.d/98%{name}/*
+%{_datadir}/selinux/packages/haveged-semaphore.pp
 
 %files devel
 %{_mandir}/man3/libhavege.3*
@@ -106,6 +120,7 @@ cp -p COPYING README ChangeLog AUTHORS contrib/build/havege_sample.c %{buildroot
 
 %changelog
 * Thu Jun 18 2026 Jirka Hladky <hladky.jiri@gmail.com> - 1.9.23-2
+- Add SELinux policy module to allow semaphore creation in /dev/shm
 - Add rpminspect.yaml to waive pre-existing annocheck false positive
 
 * Thu Jun 18 2026 Jirka Hladky <hladky.jiri@gmail.com> - 1.9.23-1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-19  2:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-19  2:22 [rpms/haveged] f44: Merge rawhide — add SELinux policy module for semaphore creation Jirka Hladky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox