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