# SPDX-FileCopyrightText: (c) 2026 The Secureblue Authors # # SPDX-License-Identifier: Apache-2.0 OR MIT %global modulename stdmalloc %global selinuxtype targeted Name: with-standard-malloc Version: 0.1.0 Release: 1 Summary: Wrapper to run commands with standard memory allocator License: Apache-2.0 URL: https://github.com/secureblue/%{name} Source: %{url}/archive/refs/tags/v%{version}.tar.gz BuildRequires: cargo-rpm-macros BuildRequires: make BuildRequires: selinux-policy-devel %description A wrapper program that hides /etc/ld.so.preload from the view of a process, allowing it to be run with the standard memory allocator when hardened_malloc is configured to be preloaded system-wide. This is designed for use within secureblue. %prep %autosetup %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -t %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies cd selinux make -f %{_datadir}/selinux/devel/Makefile %{modulename}.pp bzip2 -9 %{modulename}.pp %install install -Dp -m 0755 -t %{buildroot}%{_bindir} target/rpm/%{name} install -Dp -m 0644 -t %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype} selinux/%{modulename}.pp.bz2 install -Dp -m 0644 -t %{buildroot}%{_datadir}/selinux/devel/include/distributed selinux/%{modulename}.if %files %license LICENSES/Apache-2.0.txt %license LICENSE.dependencies %{_bindir}/%{name} %package -n stdmalloc-selinux Summary: SELinux policy for with-standard-malloc License: Apache-2.0 OR MIT BuildArch: noarch Requires: selinux-policy-%{selinuxtype} Requires(post): selinux-policy-%{selinuxtype} %{?selinux_requires_min} Recommends: %{name} %description -n stdmalloc-selinux SELinux policy for with-standard-malloc. %pre -n stdmalloc-selinux %selinux_relabel_pre -s %{selinuxtype} %post -n stdmalloc-selinux %selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 %postun -n stdmalloc-selinux if [ "$1" -eq 0 ]; then %selinux_modules_uninstall -s %{selinuxtype} %{modulename} %selinux_relabel_post -s %{selinuxtype} fi %posttrans -n stdmalloc-selinux %selinux_relabel_post -s %{selinuxtype} %files -n stdmalloc-selinux %license LICENSES/Apache-2.0.txt %license LICENSES/MIT.txt %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.* %{_datadir}/selinux/devel/include/distributed/%{modulename}.if %ghost %verify(not md5 size mode mtime) %{_selinux_store_path}/%{selinuxtype}/active/modules/200/%{modulename} %changelog * Thu Nov 19 2026 Daniel Hast - v0.1.0-1 - Initial RPM release