f731f1
Summary: SELinux Translation Daemon
f731f1
Name: mcstrans
c01fd8
Version: 2.9
2ea272
Release: 2%{?dist}
f731f1
License: GPL+
f731f1
Url: https://github.com/SELinuxProject/selinux/wiki
c01fd8
Source: https://github.com/SELinuxProject/selinux/releases/download/20190315/mcstrans-2.9.tar.gz
f731f1
Source2: secolor.conf.8
c01fd8
# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done
c01fd8
Patch0001: 0001-mcstrans-Fir-RESOURCE_LEAK-and-USE_AFTER_FREE-coveri.patch
c01fd8
Patch0002: 0002-mcstrans-Do-not-accept-incomplete-contexts.patch
2ea272
Patch0003: 0003-Revert-mcstransd-select-correct-colour-range.patch
2ea272
Patch0004: 0004-Fix-mcstrans-secolor-examples.patch
f731f1
BuildRequires: gcc
f731f1
BuildRequires: libselinux-devel >= %{version}
f731f1
BuildRequires: libcap-devel pcre-devel libsepol-devel libsepol-static
f731f1
BuildRequires: systemd
f731f1
Requires: pcre
f731f1
%{?systemd_requires}
f731f1
Provides: setransd
f731f1
Provides: libsetrans
f731f1
Obsoletes: libsetrans
f731f1
f731f1
%description
f731f1
Security-enhanced Linux is a feature of the Linux® kernel and a number
f731f1
of utilities with enhanced security functionality designed to add
f731f1
mandatory access controls to Linux.  The Security-enhanced Linux
f731f1
kernel contains new architectural components originally developed to
f731f1
improve the security of the Flask operating system. These
f731f1
architectural components provide general support for the enforcement
f731f1
of many kinds of mandatory access control policies, including those
f731f1
based on the concepts of Type Enforcement®, Role-based Access
f731f1
Control, and Multi-level Security.
f731f1
f731f1
mcstrans provides an translation daemon to translate SELinux categories 
f731f1
from internal representations to user defined representation.
f731f1
f731f1
%prep
c01fd8
%autosetup -p 2 -n mcstrans-%{version}
f731f1
f731f1
%build
c01fd8
%set_build_flags
c01fd8
make LIBDIR="%{_libdir}" %{?_smp_mflags}
f731f1
f731f1
%install
f731f1
mkdir -p %{buildroot}/%{_lib}
f731f1
mkdir -p %{buildroot}/%{_libdir}
f731f1
mkdir -p %{buildroot}%{_usr}/share/mcstrans
f731f1
mkdir -p %{buildroot}%{_sysconfdir}/selinux/mls/setrans.d
f731f1
f731f1
make DESTDIR="%{buildroot}" LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" SBINDIR="%{_sbindir}" install
f731f1
rm -f %{buildroot}%{_libdir}/*.a
f731f1
cp -r share/* %{buildroot}%{_usr}/share/mcstrans/
f731f1
# Systemd 
f731f1
mkdir -p %{buildroot}%{_unitdir}
f731f1
ln -s %{_unitdir}/mcstrans.service %{buildroot}/%{_unitdir}/mcstransd.service
f731f1
rm -rf %{buildroot}/%{_sysconfdir}/rc.d/init.d/mcstrans
f731f1
install -m644 %{SOURCE2} %{buildroot}%{_mandir}/man8/
f731f1
f731f1
%clean
f731f1
rm -rf %{buildroot}
f731f1
f731f1
%post 
f731f1
%systemd_post mcstransd.service
f731f1
f731f1
%preun
f731f1
%systemd_preun mcstransd.service
f731f1
f731f1
%postun 
f731f1
%systemd_postun mcstransd.service
f731f1
f731f1
%files
f731f1
%defattr(-,root,root,0755)
f731f1
%{_mandir}/man8/mcs.8.gz
f731f1
%{_mandir}/man8/mcstransd.8.gz
f731f1
%{_mandir}/man8/setrans.conf.8.gz
c01fd8
%{_mandir}/ru/man8/mcs.8.gz
c01fd8
%{_mandir}/ru/man8/mcstransd.8.gz
c01fd8
%{_mandir}/ru/man8/setrans.conf.8.gz
f731f1
%{_mandir}/man8/secolor.conf.8.gz
f731f1
/usr/sbin/mcstransd
f731f1
%{_unitdir}/mcstrans.service
f731f1
%{_unitdir}/mcstransd.service
f731f1
%dir %{_sysconfdir}/selinux/mls/setrans.d
f731f1
f731f1
%dir %{_usr}/share/mcstrans
f731f1
f731f1
%defattr(0644,root,root,0755)
f731f1
%dir %{_usr}/share/mcstrans/util
f731f1
%dir %{_usr}/share/mcstrans/examples
f731f1
%{_usr}/share/mcstrans/examples/*
f731f1
f731f1
%defattr(0755,root,root,0755)
f731f1
%{_usr}/share/mcstrans/util/*
f731f1
f731f1
%changelog
2ea272
* Fri Nov 08 2019 Vit Mojzis <vmojzis@redhat.com> - 2.9-2
2ea272
- Revert "mcstransd select correct colour range." (#1731451)
2ea272
- Fix mcstrans secolor examples (#1731451)
2ea272
c01fd8
* Fri Apr 12 2019 Petr Lautrbach <plautrba@redhat.com> - 2.9-1.2
c01fd8
- SELinux userspace 2.9 release
c01fd8
f731f1
* Sun Dec 16 2018 Petr Lautrbach <plautrba@redhat.com> - 2.8-2
f731f1
- Fix RESOURCE_LEAK and USE_AFTER_FREE coverity scan defects
f731f1
f731f1
* Tue Oct  2 2018 Petr Lautrbach <plautrba@redhat.com> - 2.8-1
f731f1
- Update to mcstrans-2.8
f731f1
f731f1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-11
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
f731f1
f731f1
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-10
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f731f1
f731f1
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-9
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f731f1
f731f1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-8
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f731f1
f731f1
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-7
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f731f1
f731f1
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-6
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
f731f1
f731f1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-5
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f731f1
f731f1
* Wed Mar 19 2014 Karsten Hopp |karsten@redhat.com> - 0.3.4-4
f731f1
- fix changelog order so that it builds with a recent rpm
f731f1
f731f1
* Wed Oct 16 2013 Dan Walsh <dwalsh@redhat.com> - 0.3.4-3
f731f1
- Make mcstrans PIE and fully relro 
f731f1
- Resolves: #983268
f731f1
f731f1
* Tue Oct 15 2013 Dan Walsh <dwalsh@redhat.com> - 0.3.4-2
f731f1
- Add RELRO support for long running services
f731f1
f731f1
* Thu Sep 12 2013 Dan Walsh <dwalsh@redhat.com> - 0.3.4-1
f731f1
- Update to latest version/applying patches
f731f1
- Move binary to /usr/sbin rather then /sbin
f731f1
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.3-8
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f731f1
f731f1
* Tue Mar 26 2013 Dan Walsh <dwalsh@redhat.com> - 0.3.3-7
f731f1
- Add secolor.conf.5 man page
f731f1
- Make mcstransd watch for content being written to /run/setrans for files names containing translations.
f731f1
-- This will allow apps like libvirt to write content nameing randomly selected MCS labels
f731f1
- Fix memory leak in mcstransd
f731f1
f731f1
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.3-6
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f731f1
f731f1
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.3-5
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f731f1
f731f1
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 0.3.3-4
f731f1
- Rebuild against PCRE 8.30
f731f1
f731f1
* Thu Feb 2 2012 Dan Walsh <dwalsh@redhat.com> - 0.3.3-3
f731f1
- Fix the systemd service file
f731f1
f731f1
* Wed Feb 1 2012 Dan Walsh <dwalsh@redhat.com> - 0.3.3-2
f731f1
- Update to upstream
f731f1
- Write pid file
f731f1
f731f1
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-2
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f731f1
f731f1
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-1
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f731f1
f731f1
* Wed Jan  5 2011 Ted X Toth <txtoth@gmail.com> - 0.3.2-0
f731f1
- Add constraints
f731f1
- Add setrans.conf man page
f731f1
- Fix mixed raw and translated range bug
f731f1
- Moved todo comments to TODO file
f731f1
f731f1
* Fri Oct 16 2009 Dan Walsh <dwalsh@redhat.com> 0.3.1-4
f731f1
- Add mcstransd man page
f731f1
f731f1
* Thu Sep 17 2009 Miroslav Grepl <mgrepl@redhat.com> 0.3.1-3
f731f1
- Fix init script
f731f1
f731f1
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-2
f731f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
f731f1
f731f1
* Thu Feb 5 2009 Joe Nall <joe@nall.com> 0.3.1-1
f731f1
- Rewrite translations to allow individual word/category mapping
f731f1
- Eamon Walsh's color mapping changes
f731f1
f731f1
* Wed May 28 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2.11-2
f731f1
- fix license tag
f731f1
f731f1
* Wed May 7 2008 Dan Walsh <dwalsh@redhat.com> 0.2.11-1
f731f1
- More fixes from Jim Meyering
f731f1
f731f1
* Tue May 6 2008 Dan Walsh <dwalsh@redhat.com> 0.2.10-1
f731f1
- More error checking on failed strdup
f731f1
f731f1
* Tue May 6 2008 Dan Walsh <dwalsh@redhat.com> 0.2.9-1
f731f1
- Start mcstrans before netlabel
f731f1
f731f1
* Mon Apr 14 2008 Dan Walsh <dwalsh@redhat.com> 0.2.8-1
f731f1
- Fix error handling
f731f1
f731f1
* Tue Feb 12 2008 Dan Walsh <dwalsh@redhat.com> 0.2.7-2
f731f1
- Rebuild for gcc 4.3
f731f1
f731f1
* Tue Oct 30 2007 Steve Conklin <sconklin@redhat.com> - 0.2.7-1
f731f1
- Folded current patches into tarball
f731f1
f731f1
* Thu Oct 25 2007 Steve Conklin <sconklin@redhat.com> - 0.2.6-3
f731f1
- Fixed a compile problem with max_categories
f731f1
f731f1
* Thu Oct 25 2007 Steve Conklin <sconklin@redhat.com> - 0.2.6-2
f731f1
- Fixed some init script errors
f731f1
f731f1
* Thu Sep 13 2007 Dan Walsh <dwalsh@redhat.com> 0.2.6-1
f731f1
- Check for max_categories and error out
f731f1
f731f1
* Thu Mar 1 2007 Dan Walsh <dwalsh@redhat.com> 0.2.5-1
f731f1
- Fix case where s0=""
f731f1
f731f1
* Mon Feb 26 2007 Dan Walsh <dwalsh@redhat.com> 0.2.4-1
f731f1
- Translate range if fully specified correctly
f731f1
f731f1
* Mon Feb 12 2007 Dan Walsh <dwalsh@redhat.com> 0.2.3-1
f731f1
- Additional fix to handle ssh root/sysadm_r/s0:c1,c2
f731f1
Resolves: #224637
f731f1
f731f1
* Mon Feb 5 2007 Dan Walsh <dwalsh@redhat.com> 0.2.1-1
f731f1
- Rewrite to handle MLS properly
f731f1
Resolves: #225355
f731f1
f731f1
* Mon Jan 29 2007 Dan Walsh <dwalsh@redhat.com> 0.1.10-2
f731f1
- Cleanup memory when complete
f731f1
f731f1
* Mon Dec 4 2006 Dan Walsh <dwalsh@redhat.com> 0.1.10-1
f731f1
- Fix Memory Leak
f731f1
Resolves: #218173
f731f1
f731f1
* Thu Sep 21 2006 Dan Walsh <dwalsh@redhat.com> 0.1.9-1
f731f1
- Add -pie
f731f1
- Fix compiler warnings
f731f1
- Fix Memory Leak
f731f1
Resolves: #218173
f731f1
f731f1
* Wed Sep 13 2006 Peter Jones <pjones@redhat.com> - 0.1.8-3
f731f1
- Fix subsys locking in init script
f731f1
f731f1
* Wed Aug 23 2006 Dan Walsh <dwalsh@redhat.com> 0.1.8-1
f731f1
- Only allow one version to run
f731f1
f731f1
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - sh: line 0: fg: no job control
f731f1
- rebuild
f731f1
f731f1
* Mon Jun 19 2006 Dan Walsh <dwalsh@redhat.com> 0.1.7-1
f731f1
- Apply sgrubb patch to only call getpeercon on translations
f731f1
f731f1
* Tue Jun 6 2006 Dan Walsh <dwalsh@redhat.com> 0.1.6-1
f731f1
- Exit gracefully when selinux is not enabled
f731f1
f731f1
* Mon May 15 2006 Dan Walsh <dwalsh@redhat.com> 0.1.5-1
f731f1
- Fix sighup handling
f731f1
f731f1
* Mon May 15 2006 Dan Walsh <dwalsh@redhat.com> 0.1.4-1
f731f1
- Add patch from sgrubb
f731f1
- 	Fix 64 bit size problems
f731f1
- 	Increase the open file limit
f731f1
-	Make sure maximum size is not exceeded
f731f1
f731f1
* Fri May 12 2006 Dan Walsh <dwalsh@redhat.com> 0.1.3-1
f731f1
- Move initscripts to /etc/rc.d/init.d
f731f1
f731f1
* Thu May 11 2006 Dan Walsh <dwalsh@redhat.com> 0.1.2-1
f731f1
- Drop Privs
f731f1
f731f1
* Mon May 8 2006 Dan Walsh <dwalsh@redhat.com> 0.1.1-1
f731f1
- Initial Version
f731f1
- This daemon reuses the code from libsetrans